builders: Adapt to autobuilder-helper argparse changes

In particular this lets us drop the horrible 'None' sentinals.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2018-08-30 14:43:53 +01:00
parent 40fe66b97f
commit 772544ee27

View File

@ -95,7 +95,7 @@ def get_publish_internal(props, basename=False):
return os.path.basename(dest) return os.path.basename(dest)
return dest return dest
else: else:
return "None" return ""
@util.renderer @util.renderer
def get_publish_dest(props): def get_publish_dest(props):
@ -113,11 +113,11 @@ def ensure_props_set(props):
correct defaults are set and passed to the helper scripts. correct defaults are set and passed to the helper scripts.
""" """
return { return {
"sharedrepolocation": props.getProperty("sharedrepolocation", "None"), "sharedrepolocation": props.getProperty("sharedrepolocation", ""),
"is_release": props.getProperty("is_release", False), "is_release": props.getProperty("is_release", False),
"buildappsrcrev": props.getProperty("buildappsrcrev", "None"), "buildappsrcrev": props.getProperty("buildappsrcrev", ""),
"deploy_artefacts": props.getProperty("deploy_artefacts", False), "deploy_artefacts": props.getProperty("deploy_artefacts", False),
"publish_destination": props.getProperty("publish_destination", "None") "publish_destination": props.getProperty("publish_destination", "")
} }
def get_buildlogs(): def get_buildlogs():
@ -147,10 +147,10 @@ def create_builder_factory():
f.addStep(steps.ShellCommand( f.addStep(steps.ShellCommand(
command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"), command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
util.Interpolate("%(prop:sharedrepolocation)s"),
util.Interpolate("%(prop:builddir)s/build"), util.Interpolate("%(prop:builddir)s/build"),
util.Property("buildername"), util.Property("buildername"),
util.Property("is_release")], "-c", util.Interpolate("%(prop:sharedrepolocation)s"),
"-p", get_publish_dest],
haltOnFailure=True, haltOnFailure=True,
name="Unpack shared repositories")) name="Unpack shared repositories"))
@ -166,10 +166,11 @@ def create_builder_factory():
util.Interpolate("%(prop:builddir)s/build/build"), util.Interpolate("%(prop:builddir)s/build/build"),
util.Interpolate("%(prop:branch_poky)s"), util.Interpolate("%(prop:branch_poky)s"),
util.Interpolate("%(prop:repo_poky)s"), util.Interpolate("%(prop:repo_poky)s"),
get_sstate_release_number, "-s", get_sstate_release_number,
util.Interpolate("%(prop:buildappsrcrev)s"), "-b", util.Interpolate("%(prop:buildappsrcrev)s"),
get_publish_dest, "-p", get_publish_dest,
util.URLForBuild], "-u", util.URLForBuild,
"-q"],
name="run-config", name="run-config",
logfiles=get_buildlogs(), logfiles=get_buildlogs(),
lazylogfiles=True, lazylogfiles=True,
@ -207,8 +208,8 @@ factory.addStep(steps.ShellCommand(
command=[ command=[
util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/prepare-shared-repos"), util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/prepare-shared-repos"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir)), "-c", util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir)),
get_publish_dest], "-p", get_publish_dest],
haltOnFailure=True, haltOnFailure=True,
name="Prepare shared repositories")) name="Prepare shared repositories"))
factory.addStep(steps.SetProperty( factory.addStep(steps.SetProperty(
@ -221,10 +222,10 @@ factory.addStep(steps.ShellCommand(
command=[ command=[
util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"), util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir)),
util.Interpolate("%(prop:builddir)s/build"), util.Interpolate("%(prop:builddir)s/build"),
util.Property("buildername"), util.Property("buildername"),
util.Property("is_release")], "-c", util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir)),
"-p", util.Property("is_release")],
haltOnFailure=True, haltOnFailure=True,
name="Unpack shared repositories")) name="Unpack shared repositories"))
@ -241,10 +242,10 @@ factory.addStep(RunConfigLogObserver(
util.Interpolate("%(prop:builddir)s/build/build"), util.Interpolate("%(prop:builddir)s/build/build"),
util.Interpolate("%(prop:branch_poky)s"), util.Interpolate("%(prop:branch_poky)s"),
util.Interpolate("%(prop:repo_poky)s"), util.Interpolate("%(prop:repo_poky)s"),
get_sstate_release_number, "-s", get_sstate_release_number,
"None", "-p", get_publish_dest,
get_publish_dest, "-u", util.URLForBuild,
util.URLForBuild], "-q"],
name="run-config", name="run-config",
logfiles=get_buildlogs(), logfiles=get_buildlogs(),
lazylogfiles=True, lazylogfiles=True,
@ -255,7 +256,7 @@ def get_props_set():
set_props = { set_props = {
"sharedrepolocation": util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir)), "sharedrepolocation": util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir)),
"is_release": util.Property("is_release"), "is_release": util.Property("is_release"),
"buildappsrcrev": "None", "buildappsrcrev": "",
"deploy_artefacts": util.Property("deploy_artefacts"), "deploy_artefacts": util.Property("deploy_artefacts"),
"publish_destination": util.Property("publish_destination"), "publish_destination": util.Property("publish_destination"),
} }
@ -276,9 +277,9 @@ factory.addStep(steps.ShellCommand(
util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/send-qa-email"), util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/send-qa-email"),
util.Property("send_email"), util.Property("send_email"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
get_publish_dest, util.Interpolate("%(prop:sharedrepolocation)s"),
get_publish_name, "-p", get_publish_dest,
util.Interpolate("%(prop:sharedrepolocation)s") "-r", get_publish_name
], ],
name="Send QA Email")) name="Send QA Email"))