Add uploading #22
|
@ -22,3 +22,14 @@ def is_test_script_available(props):
|
|||
@util.renderer
|
||||
def isnt_test_script_available(props):
|
||||
return not _is_test_script_available(props)
|
||||
|
||||
def _files_to_upload(props):
|
||||
return ','.join(props.getProperty(files_to_upload).split("\n"), default="")
|
||||
|
||||
@util_renderer
|
||||
def files_to_upload(props):
|
||||
return files_to_upload(props)
|
||||
|
||||
@util_renderer
|
||||
def no_files_to_upload(props):
|
||||
return not _files_to_upload(props)
|
||||
|
|
|
@ -63,9 +63,37 @@ def add_child_sh_steps(build_factory, directory=".buildbot"):
|
|||
|
||||
build_factory.addStep(
|
||||
steps.ShellCommand(
|
||||
name= util.Interpolate("test_%(prop:jobname)s"),
|
||||
name=util.Interpolate("test_%(prop:jobname)s"),
|
||||
command=util.Interpolate("%(kw:directory)s/%(prop:jobname)s/test.sh", directory=directory),
|
||||
doStepIf=is_test_script_available,
|
||||
hideStepIf=isnt_test_script_available,
|
||||
)
|
||||
)
|
||||
|
||||
build_factory.addStep(
|
||||
steps.SetPropertyFromCommand(
|
||||
name="Find files to upload",
|
||||
command="find out -maxdepth 0 -mindepth 0 "
|
||||
"-type f -printf {'%P\n'}",
|
||||
workdir="out",
|
||||
hideStepIf=True,
|
||||
property="files_to_upload"
|
||||
)
|
||||
)
|
||||
|
||||
build_factory.addStep(
|
||||
steps.ShellCommand(
|
||||
name="Upload files",
|
||||
workdir="out",
|
||||
doStepIf=files_to_upload,
|
||||
hideStepIf=no_files_to_upload,
|
||||
command=util.Interpolate(
|
||||
"curl -T {%s} "
|
||||
"https://buildbot@%{s}:artifacts.bitmessage.at/%s/%s/",
|
||||
files_to_upload,
|
||||
util.Secret('artifact_upload'),
|
||||
util.Property('jobname'),
|
||||
util.Property('buildnumber'),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user