Jenkins: Build / “Execute shell” / exit codes …

From the help section of “Execute Shell”:

By default, the shell will be invoked with the “-ex” option. So all of the commands are printed before being executed, and the build is considered a failure if any of the commands exits with a non-zero exit code. Again, add the #!/bin/... line to change this behavior.

Funny, “set -e” (“exit immediately if … exits with a non-zero status”) is being applied, just as it is with good old “make”.

There are pros and cons for that. But in the end I can seriously not live with it, because I can’t have a single file or directory test, that (expectedly!) exits non-zero.

Another funny aspect (the bash man page says):

Subshells spawned to execute command substitution inherit the value of the -e option from the parent shell. When not in posix mode, bash clears the -e option in such subshells.


Comments

One response to “Jenkins: Build / “Execute shell” / exit codes …”

  1. r00t avatar
    r00t

    you can have that, but it has to be enclosed in a test or a subshell or….

    i’m a big fan of +e and +u

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.