DotCi
DotCi copied to clipboard
Fail gracefully with DASH
In BuildConfiguration.java line 120 to 125 there are a bunch of commands to clean up docker container. These commands are specifically written for bash. For example:
Line 121 docker inspect %s_%s_1 &>/dev/null will exit 0 on error condition in bash but will instant exit 1 in dash. This command and others, along with set -e Will make a successful build be marked as failure without any explanation as to why.
This may not be an issue, until you realize new instances of Ubuntu by default do this:
/bin/sh -> dash
Not
/bin/sh ->
Good Fix: make these commands work both in Bash and Dash.
Fast Fix: check the shell type and if not bash print a warning saying the default she'll should be bash.