builders/runconfig: Add ability to skip targets if the don't exist in the branch configuration

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2020-11-20 17:32:41 +00:00
parent eef335b400
commit c8db821860
2 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@ from buildbot.plugins import *
from yoctoabb import config
from yoctoabb.steps.writelayerinfo import WriteLayerInfo
from yoctoabb.steps.runconfig import get_publish_dest, get_publish_resultdir, get_publish_name, RunConfigCheckSteps
from yoctoabb.steps.runconfig import get_publish_dest, get_publish_resultdir, get_publish_name, RunConfigCheckSteps, TargetPresent
from buildbot.process.results import Results, SUCCESS, FAILURE, CANCELLED, WARNINGS, SKIPPED, EXCEPTION, RETRY
from twisted.python import log
@ -53,6 +53,7 @@ def create_builder_factory():
mode='incremental',
haltOnFailure=True,
name='Fetch yocto-autobuilder-helper'))
f.addStep(TargetPresent())
f.addStep(steps.SetProperties(properties=ensure_props_set))
f.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True))
f.addStep(steps.ShellCommand(

View File

@ -201,3 +201,17 @@ class RunConfigCheckSteps(shell.ShellCommand):
except KeyError:
log = yield self.addLog(logName)
log.addStdout(message)
class TargetPresent(shell.ShellCommand):
name = "Check if branch needs this target"
command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/target-present"), util.Property("buildername")]
def evaluateCommand(self, cmd):
# If the command fails, fall back to old style run-config execution
rc = super().evaluateCommand(cmd)
if rc != SUCCESS:
self.finished(SKIPPED)
self.build.results = SKIPPED
self.descriptionDone = "Target not present in branch configuration"
self.build.buildFinished(["Target not present in branch configuration"], SKIPPED)
return SUCCESS