diff --git a/lib/renderers.py b/lib/renderers.py index f8632f1..e638146 100644 --- a/lib/renderers.py +++ b/lib/renderers.py @@ -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) diff --git a/multibuild.py b/multibuild.py index 1d70c94..bcb64dc 100644 --- a/multibuild.py +++ b/multibuild.py @@ -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'), + ) + ) + )