Stopping the pipeline on first failure


I have three shell scripts that execute in order. Each has ‘set -e’ in place to ensure that the return code is non-zero. I expected the pipeline to stop at first failure. It does not. I see, but I cannot figure out how to configure it for a non-YAML pipeline.

Of course, I have a workaround - I can delete two of the .sh scripts and put their contents in a single monolithic one. Defeats the elegance of a build pipeline, of course :-(


  • Paul


Hey Paul, by the sounds of it - I think you should be able to split your 3 shell scripts into 3 seperate build steps, with a “wait” step in between.

In YAML, it’d look something like this:

  - command: “”
  - wait
  - command: “”
  - wait
  - command: “”

And using the Step UI it’d look like this:

With this setup, the pipeline will fail and stop running if script1 or script2 fails.

Does something like that work?


Trying that now Keith. I was looking in the wrong place!! (user error)


No worries, let me know how you go!