Add CI documentation about using `set -e` with Bash
When writing scrips for CI it may be extremely helpful to use set -e
with Bash, see https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
Exit immediately if a pipeline (see Pipelines), which may consist of a single simple command (see Simple Commands), a list (see Lists), or a compound command (see Compound Commands) returns a non-zero status. The shell does not exit if the command that fails is part of the command list immediately following a while or until keyword, part of the test in an if statement, part of any command executed in a && or || list except the command following the final && or ||, any command in a pipeline but the last, or if the command’s return status is being inverted with !. If a compound command other than a subshell returns a non-zero status because a command failed while -e was being ignored, the shell does not exit. A trap on ERR, if set, is executed before the shell exits.
One thing to note, is that GitLab Runners sets set -e
by default, but this does not propagate to scripts created by user (https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/shells/bash.go#L171).