Skip to content

Instantly share code, notes, and snippets.

@gsemet
Last active August 29, 2015 14:12
Show Gist options
  • Save gsemet/f99a1215c66cad650557 to your computer and use it in GitHub Desktop.
Save gsemet/f99a1215c66cad650557 to your computer and use it in GitHub Desktop.
class TriggerSample(SimpleTriggerStep):
descriptionSkipped = "nothing configured"
def addRuntimeSchedulerNames(self):
a_list = ...
autoemr = ['triggerable-{}-mergerequest'.format(a) for a in a_list]
return autoemr
def postExecute(self, res):
if res == SKIPPED:
branch_name = self.getProperty("branch_name")
self.addLogStdout("No setting in configuration of branch {!r}"
.format(branch_name))
self.addLogStdout("Result is SKIPPED")
elif res == FAILURE:
self.addLogError("Error occured: {!r}".format(self.getStepStatusText()), stdio=True)
if some_condition:
res = WARNING
elif res == SUCCESS:
self.addLogStdout("Builds succesfully triggered")
return res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment