My first stage runs a shell script. Exit 0 marks it as success and exit 1 marks it as fail. How can I read this result into the pipeline and get the desired behavior:
- Run stage 1
- If stage 1 fails, don't run the remaining stages, but mark the whole pipeline as a success
- If stage 1 succeeds, run the remaining stages
- If any of them fail, mark the pipeline as a fail
- If they all succeed, mark the pipeline as a success
I am doing this in a declarative pipeline, how can I enforce this behavior?