I have serveral lines in my pipeline but I want all lines be executed even if a line fails.
For example, line2 return code 10 but I want line3 to be executed even if line2 is ko
pipelines:
default:
- step:
script:
- line1
- line2
- line3How can I do that?
Pipelines achieves the default behaviour of exiting on first error by prepending your script with the "set -e" bash command. You can "undo" this at any point in your script using the command "set +e". If you want all the commands in your script to execute regardless of errors then put "set +e" at the top of your script. If you just want to ignore the error for one particular command then put "set +e" before that command and "set -e" after it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.