Can I stop an entire pipeline from a script in a step without having it fail?
In our case we have multiple triggers for a pipeline, but it only has to run in a specific case, when all other processes have finished.
I would like to stop all other steps if the check fails in the first step without failing the pipeline, because this is a known stop and therefore should not trigger a failed status.
My current alternative is to do the check on the start of each step, which works, but does not indicate stoped in the overview of the pipeline and is inefficient.
Hope someone can help!
Thanks in advance.
I would also be interested in a solution to this. Currently I've worked around it by merging my steps in a single script that does the initial check. If conditions aren't met it simply exits. Otherwise it continues calling each subsequent step scripts.
The downside is that from the UI I only get the 1 step without being able to really trace individual steps or configuring them separately with size, cache max-time etc.
Hi again!
As an update I just want to mention that in the end, I reverted the solution mentioned above to instead pass data between my steps using artifacts as per https://community.atlassian.com/t5/Bitbucket-questions/Is-there-a-way-of-sharing-data-between-steps-in-bitbucket/qaq-p/777977
In my conditional step I do the needed checks and store the result in an artifact e.g. "runTests". Then in the subsequent steps I check for if that artifact exists before continuing with the step. If it doesn't the step script is completed without having to fail.
It's not optimal as you also point out, in that you still have the step boot up overhead but it's the only solution I've found so far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, that's our current solution as well, but still multiple steps are started and build minutes are used.
Truly hope Atlassian reads this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.