diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-11-28 13:03:46 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-11-29 12:36:38 +0000 |
commit | 8dc928d5ea364e2f12ecb6a1165eba60e9784392 (patch) | |
tree | 7a8527ce709db9b2bf35f57dca154bbb421d90b3 /tools | |
parent | 0dd271a5c2e3e3889d0b06c7041af7746784607d (diff) |
travis-ci: run in bash, with the "unofficial strict mode"
set -u forces us to set all variables that we use (for example with the
${foo:=bar} syntax to take an existing value or set a default), or use the
${foo:-bar} syntax to make it explicit that the variable might be unset.
set -o pipefail (which is a bash feature) detects failure in non-last
elements of a pipeline.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98889
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/ci-build.sh | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/tools/ci-build.sh b/tools/ci-build.sh index 7b3b55feb..d85b28f0d 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright © 2015-2016 Collabora Ltd. # @@ -22,27 +22,17 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -set -e +set -euo pipefail set -x -if [ -z "$ci_variant" ]; then - ci_variant=production -fi - -if [ -z "$ci_host" ]; then - ci_host=native -fi - -if [ -z "$ci_buildsys" ]; then - ci_buildsys=autotools -fi - -if [ -z "$ci_parallel" ]; then - ci_parallel=1 -fi - -ci_test=yes -ci_test_fatal=yes +NULL= +: "${ci_buildsys:=autotools}" +: "${ci_host:=native}" +: "${ci_parallel:=1}" +: "${ci_sudo:=no}" +: "${ci_test:=yes}" +: "${ci_test_fatal:=yes}" +: "${ci_variant:=production}" NOCONFIGURE=1 ./autogen.sh |