from buildbot.data import resultspec
from buildbot.changes.gitpoller import GitPoller
from buildbot.config import BuilderConfig
+from buildbot.process import buildstep
from buildbot.plugins import reporters
from buildbot.plugins import schedulers
from buildbot.plugins import steps
)
+# CUSTOM CLASS
+
+# Extension of ShellCommand and sets in property:
+# - True: the command succeded
+# - False: the command failed
+class ShellCommandAndSetProperty(buildstep.ShellMixin, buildstep.BuildStep):
+ name = "shellandsetproperty"
+ renderables = ['property']
+
+ def __init__(
+ self,
+ property=None,
+ **kwargs,
+ ):
+ kwargs = self.setupShellMixin(kwargs)
+
+ self.property = property
+
+ super().__init__(**kwargs)
+
+ @defer.inlineCallbacks
+ def run(self):
+ cmd = yield self.makeRemoteShellCommand()
+
+ yield self.runCommand(cmd)
+
+ self.setProperty(self.property, not cmd.didFail(), "ShellCommandAndSetProperty Step")
+
+ return cmd.results()
+
+
# NB the phase1 build factory assumes workers are single-build only
def prepareFactory(target):
(target, subtarget) = target.split("/")