diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2019-05-31 15:33:40 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-05-31 20:21:12 +0200 |
commit | b7b418ec6d5a540ff7ddfc7103a617de7605a1bc (patch) | |
tree | 25013f0757644635cb3b86553947512ae5bb9a42 /travis.sh | |
parent | fa082fbab000396509712423e57e7945e5b66383 (diff) | |
download | sonarqube-b7b418ec6d5a540ff7ddfc7103a617de7605a1bc.tar.gz sonarqube-b7b418ec6d5a540ff7ddfc7103a617de7605a1bc.zip |
Treat using unset variables as error in Travis script
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/travis.sh b/travis.sh index a88b1206e08..a6562ef8912 100755 --- a/travis.sh +++ b/travis.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -eo pipefail +set -euo pipefail ./.travis/setup_ramdisk.sh @@ -38,7 +38,9 @@ BUILD) git fetch --unshallow ./gradlew build --no-daemon --console plain -PjacocoEnabled=true - if [[ -n "${SONAR_TOKEN}" ]]; then + # the '-' at the end is needed when using set -u (the 'nounset' flag) + # see https://stackoverflow.com/a/9824943/641955 + if [[ -n "${SONAR_TOKEN-}" ]]; then ./gradlew sonarqube --no-daemon --console plain \ -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ -Dsonar.organization=sonarsource \ |