I'm trying to create a build configuration with BuildBot using conditional steps. In particular, I want to have conditional steps based on whether or not a preceding step failed, something like this:
factory = util.BuildFactory()
factory.addStep(MyCoolStep())
factory.addStep(CommitWork(), doStepIf='MyCoolStepWorked')
factory.addStep(RollbackWork(), doStepIf='MyCoolStepFailed')
According to the docs, the 'doStepIf' takes a boolean qualifier. How do I access the result of a preceding step? Or do I need to set a custom property somewhere? I'm somewhat new to Python, so I'm not sure about the scoping of various variables and objects in the buildbot master config.
Each step in Buildbot returns as status either
SUCCESS,WARNINGS,SKIPPED,FAILURE,CANCELLED,EXCEPTION,RETRYSo if
MyCoolStepworked, it sets the build status toSUCCESS, which you can check forCommitWorkto execute it.For
RollbackWorkflowyou can check whether the build is inFAILUREstate and execute it. SinceCommitWorkis skipped in this state, the overall state won't upgrade toSKIPPEDBoth steps are hidden if
SKIPPEDso they won't pollute the buildbot output when not executed.