Add uploading

This commit is contained in:
Peter Šurda 2022-08-08 11:21:33 +08:00
parent 85908702c9
commit fa213e5733
Signed by untrusted user: PeterSurda
GPG Key ID: 3E47497CF67ABB95
2 changed files with 40 additions and 1 deletions

View File

@ -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)

View File

@ -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'),
)
)
)