Skip to content

Commit

Permalink
SONAR-13259 Fix branch analysis on Travis CI for public repo
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-admiraal-sonarsource authored and sonartech committed Mar 27, 2020
1 parent f8c4ade commit f0defba
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0defba

Please sign in to comment.