builders.py, observery.py: Convert to *NewStyle

ShellCommandNewStyle

For buildbot 2.9.x migration

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
This commit is contained in:
Jate Sujjavanich 2022-12-06 19:45:47 -05:00
parent a5a8f1dd96
commit 2a3b33e44d
2 changed files with 12 additions and 12 deletions

View File

@ -88,7 +88,7 @@ def create_builder_factory():
# NOTE: Assumes that yocto-autobuilder repo has been cloned to home # NOTE: Assumes that yocto-autobuilder repo has been cloned to home
# directory of the user running buildbot. # directory of the user running buildbot.
clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir")
f.addStep(steps.ShellCommand( f.addStep(steps.ShellCommandNewStyle(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
haltOnFailure=True, haltOnFailure=True,
name="Clobber build dir")) name="Clobber build dir"))
@ -102,7 +102,7 @@ def create_builder_factory():
f.addStep(TargetPresent()) f.addStep(TargetPresent())
f.addStep(steps.SetProperties(properties=ensure_props_set)) f.addStep(steps.SetProperties(properties=ensure_props_set))
f.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True)) f.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True))
f.addStep(steps.ShellCommand( f.addStep(steps.ShellCommandNewStyle(
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:builddir)s/build"), util.Interpolate("%(prop:builddir)s/build"),
@ -127,7 +127,7 @@ def create_builder_factory():
f.addStep(RunConfigCheckSteps(posttrigger=False)) f.addStep(RunConfigCheckSteps(posttrigger=False))
# If the build was successful, clean up the build directory # If the build was successful, clean up the build directory
f.addStep(steps.ShellCommand( f.addStep(steps.ShellCommandNewStyle(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
doStepIf=lambda step: step.build.results == SUCCESS, doStepIf=lambda step: step.build.results == SUCCESS,
haltOnFailure=False, haltOnFailure=False,
@ -231,7 +231,7 @@ def create_parent_builder_factory(buildername, waitname):
# NOTE: Assumes that yocto-autobuilder repo has been cloned to home # NOTE: Assumes that yocto-autobuilder repo has been cloned to home
# directory of the user running buildbot. # directory of the user running buildbot.
clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir")
factory.addStep(steps.ShellCommand( factory.addStep(steps.ShellCommandNewStyle(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
haltOnFailure=True, haltOnFailure=True,
name="Clobber build dir")) name="Clobber build dir"))
@ -244,7 +244,7 @@ def create_parent_builder_factory(buildername, waitname):
haltOnFailure=True, haltOnFailure=True,
name='Fetch yocto-autobuilder-helper')) name='Fetch yocto-autobuilder-helper'))
factory.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True)) factory.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True))
factory.addStep(steps.ShellCommand( factory.addStep(steps.ShellCommandNewStyle(
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"),
@ -262,7 +262,7 @@ def create_parent_builder_factory(buildername, waitname):
factory.addStep(steps.SetProperty(property="build_type", value="quick")) factory.addStep(steps.SetProperty(property="build_type", value="quick"))
# shared-repo-unpack # shared-repo-unpack
factory.addStep(steps.ShellCommand( factory.addStep(steps.ShellCommandNewStyle(
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"),
@ -320,7 +320,7 @@ def create_parent_builder_factory(buildername, waitname):
factory.addStep(RunConfigCheckSteps(posttrigger=True)) factory.addStep(RunConfigCheckSteps(posttrigger=True))
factory.addStep(steps.ShellCommand( factory.addStep(steps.ShellCommandNewStyle(
command=[ command=[
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"),
@ -333,7 +333,7 @@ def create_parent_builder_factory(buildername, waitname):
name="Send QA Email")) name="Send QA Email"))
factory.addStep(steps.ShellCommand( factory.addStep(steps.ShellCommandNewStyle(
command=["rm", "-fr", util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir))], command=["rm", "-fr", util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir))],
haltOnFailure=True, haltOnFailure=True,
name="Remove shared repo dir")) name="Remove shared repo dir"))
@ -349,7 +349,7 @@ def create_doc_builder_factory():
# NOTE: Assumes that yocto-autobuilder repo has been cloned to home # NOTE: Assumes that yocto-autobuilder repo has been cloned to home
# directory of the user running buildbot. # directory of the user running buildbot.
clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir")
f.addStep(steps.ShellCommand( f.addStep(steps.ShellCommandNewStyle(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
haltOnFailure=True, haltOnFailure=True,
name="Clobber build dir")) name="Clobber build dir"))
@ -374,7 +374,7 @@ def create_doc_builder_factory():
mode='incremental', mode='incremental',
haltOnFailure=True, haltOnFailure=True,
name='Fetch bitbake')) name='Fetch bitbake'))
f.addStep(steps.ShellCommand( f.addStep(steps.ShellCommandNewStyle(
command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/run-docs-build"), command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/run-docs-build"),
util.Interpolate("%(prop:builddir)s"), util.Interpolate("%(prop:builddir)s"),
util.Interpolate("%(prop:builddir)s/yocto-docs"), util.Interpolate("%(prop:builddir)s/yocto-docs"),

View File

@ -9,7 +9,7 @@ from buildbot.process.results import FAILURE
from buildbot.process.results import SKIPPED from buildbot.process.results import SKIPPED
from buildbot.process.results import SUCCESS from buildbot.process.results import SUCCESS
from buildbot.process.results import WARNINGS from buildbot.process.results import WARNINGS
from buildbot.steps.shell import ShellCommand from buildbot.steps.shell import ShellCommandNewStyle
from functools import partial from functools import partial
@ -17,7 +17,7 @@ from functools import partial
# Monitor the step 1-X logs and stdio, collecting up any warnings and errors seen # Monitor the step 1-X logs and stdio, collecting up any warnings and errors seen
# and publish them at the end in their own 'logfile' for ease of access to the user # and publish them at the end in their own 'logfile' for ease of access to the user
# #
class SimpleLogObserver(ShellCommand): class SimpleLogObserver(ShellCommandNewStyle):
warnOnWarnings = True warnOnWarnings = True
warnOnFailure = True warnOnFailure = True