diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2020-03-27 13:38:20 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-03-27 20:03:46 +0000 |
commit | f0defbad20396e6ace2b3994b3a5cd2723bceb6d (patch) | |
tree | 3f9c3c825fa9d25d01f885e1a28008d2d1341709 /travis.sh | |
parent | f8c4ade234e941599771023fe080252ff8134a5a (diff) | |
download | sonarqube-f0defbad20396e6ace2b3994b3a5cd2723bceb6d.tar.gz sonarqube-f0defbad20396e6ace2b3994b3a5cd2723bceb6d.zip |
SONAR-13259 Fix branch analysis on Travis CI for public repo
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/travis.sh b/travis.sh index b6e9e369dfe..2f63ca1b30f 100755 --- a/travis.sh +++ b/travis.sh @@ -41,11 +41,20 @@ BUILD) # 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 jacocoTestReport sonarqube --info --no-daemon --console plain \ - -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ - -Dsonar.organization=sonarsource \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login="$SONAR_TOKEN" + if [[ "${TRAVIS_BRANCH}" == "master" ]]; then + ./gradlew jacocoTestReport sonarqube --info --no-daemon --console plain \ + -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ + -Dsonar.organization=sonarsource \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login="$SONAR_TOKEN" + else + ./gradlew jacocoTestReport sonarqube --info --no-daemon --console plain \ + -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ + -Dsonar.organization=sonarsource \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login="$SONAR_TOKEN" \ + -Dsonar.branch.name="$TRAVIS_BRANCH" + fi # Wait for 5mins, hopefully the report will be processed. sleep 5m |