diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2019-05-31 10:14:16 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-05-31 10:17:08 +0200 |
commit | 0783b9f2cd7168992329f8a58e8368297740688d (patch) | |
tree | 97254c468330fb7d90a4bcfda282413e65d64bcb /travis.sh | |
parent | aefa1e5ffb6e9348a5545872b48a81d470c87690 (diff) | |
download | sonarqube-0783b9f2cd7168992329f8a58e8368297740688d.tar.gz sonarqube-0783b9f2cd7168992329f8a58e8368297740688d.zip |
Fix Travis build on external pull requests
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/travis.sh b/travis.sh index 37160682941..a88b1206e08 100755 --- a/travis.sh +++ b/travis.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -euo pipefail +set -eo pipefail ./.travis/setup_ramdisk.sh @@ -36,12 +36,15 @@ case "$TARGET" in BUILD) git fetch --unshallow - ./gradlew build sonarqube --no-daemon --console plain \ - -PjacocoEnabled=true \ - -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ - -Dsonar.organization=sonarsource \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login="$SONAR_TOKEN" + ./gradlew build --no-daemon --console plain -PjacocoEnabled=true + + if [[ -n "${SONAR_TOKEN}" ]]; then + ./gradlew sonarqube --no-daemon --console plain \ + -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ + -Dsonar.organization=sonarsource \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login="$SONAR_TOKEN" + fi ;; WEB_TESTS) |