Question
I have a Jenkins pipeline with multiple stages. These stages are executed on separate worker nodes. Currently when I abort a pipeline the subsequent stages are all aborted and the build status is set to aborted.
I would like to develop the pipeline such that I can abort a stage without aborting all subsequent stages.
Build Log
Below is a sample build log of a pipeline with two stages: Stage A and Stage B. As you can see when I aborted Stage A Jenkins skips Stage B. I would like Jenkins to execute Stage B when Stage A is aborted
[Pipeline] {
[Pipeline] stage
[Pipeline] { (A)
[Pipeline] echo
Started stage A
[Pipeline] sleep
Sleeping for 20 sec
Aborted by anonymous
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (B)
Stage "B" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: ABORTED