[users at bb.net] haltOnFailure vs doStepIf
Mikhail Sobolev
mss at mawhrin.net
Mon Oct 24 04:21:11 UTC 2016
Hi Daniel,
On Sat, Oct 22, 2016 at 10:09:11PM -0700, Daniel Kauffman wrote:
> How would one make a BuildStep conditional on the build status of all
> previous steps? For example, a final build step that uploads a package to a
> staging area might be configured to do so only if all previous steps
> completed successfully, but if some steps involved running tests, we might
> want to run all of the tests even if some have already failed. The
> haltOnFailure option allows halting a build. Can the doStepIf be used to
> only run the final steps if the build status is clean? Or is there a
> preferred approach to handling this situation?
In my case I wrote a simple custom step that takes a list of build steps
that must not fail, if any of those steps are failed, then the step
itself would fail, thus stopping the build. I wrote it for the
following scenario:
* download an artifact from the staging area
* update the device with the artifact [fail here]
* run a test suite [ignore fail here]
* upload logs
* run the test suite tear down [ignore fail here]
* upload logs
* fail if test suite run or test suite tear down failed
* make the artifact available for download
If I do not forget, I'll send the code later today (I probably will PR
it, but that requires writing tests, so it will take a bit longer).
--
Misha
More information about the users
mailing list