Skip to content

Commit

Permalink
Enable sonar PR decoration (osmlab#113)
Browse files Browse the repository at this point in the history
* Enable sonar PR decoration

* Dumb mistake and upgrade gradle wrapper too
  • Loading branch information
matthieun authored and MikeGost committed Dec 18, 2018
1 parent 6e24ce8 commit 2fd747b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
- secure: "WmF6RRQnsNsVz+roINHVnoWijE4ZjPmwrWptYLYDQ12Ntd28SdX6UI8Dko3pfjQclb2aHiEJo0TIi9o8gYrPUn0wAWHDujBUOPqBRqCwS8L7x15olvd/Z5I9HfoV79et93G9OdaicqBSF1i+CIcRbMpemkN6L4mhwi7zK8BeldfJoGhfrMt9OR/IqIUGWlHQgb8TiSayC/gZhuFMiuOdnYsFToRfAf/hOtK8N1YhaFiXZovwEbsA0ChKTjK3bMPSRtWMF7PzKlDdPn8IOAFYRrCVtuCQC8pk4lumQlnApcvAJR5pYHayjOmuRi+dkg1ePkSPYO0m9VMAP6zy/VwZQrALARRa4E/+ZYELZYH8yWJOJQUc3ZHv0d7ENVv6mMQ2MSHMEHtbvkbKA/eSZcMa35aj2QXBv7wb4LcXrmI5DOvXMm1LYqjwq/ro+a5PYdXcIJzHrT+AdZzY7HcJUK/sE7nsWj2QLZaqRL4FhSlicHgnU8eBKT+zGc9SrsjRMpI3Ubcm/oGeNdtcV2RZblkSVgs84+NeaSw/ULgNi7FOmpXYoE+aad0hOKtZ33WTRq4e1ZfPyZuMKfK7AJDkiOusNFQJ2jIH1JEWWG2XwpDF1Lbopd9uyAvOaR/TEUzlD4ikfbl9zPUk8D1qtl/whodvybdZg32CzCf1EQ9ndodnLSw="
- # SONAR_TOKEN
- secure: "ixIf8Y2DKqC5IwzbDnQlIfSi3AovSgr9vxo52OxL6F68dulorCbuoKEVjoAF5kcjDli8+mjk3jjeFUO1zeBt22A6R5UIQkVAl3FImICQj0g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LzYCslt8sPAp52ltYTtJR+BquaV8B3yn5MzUUl8Fss6Bx71iJm/StgeDK3F3prpl/SmkzPuQ9+K49IxMDKJW8PnY8Yl2nWxU9AAwfZvq+ku8bkFKJH3kSt3IUtsdjL9q9skJ2nOKT6hHi16EHTunirA+Cz/Fznt8wznb7JB7n1uZ1nFwyirBpfg1njfnBAFaphmvW5jmDOQoFp9mYZhf+9Wi34Q="
- GPG_KEY_LOCATION=".travis/secring.gpg"
- ENCRYPTED_GPG_KEY_LOCATION=".travis/secring.gpg.enc"
branches:
Expand Down
24 changes: 22 additions & 2 deletions .travis/sonar.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
#!/usr/bin/env sh

if [ "$TRAVIS_EVENT_TYPE" = "cron" ];
if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "Running sonarqube in a CRON build"
SONAR_PULLREQUEST_BRANCH="$(echo $TRAVIS_PULL_REQUEST_SLUG | awk '{split($0,a,"/"); print a[1]}')/$TRAVIS_PULL_REQUEST_BRANCH"
echo "Running sonarqube in Pull Request $TRAVIS_PULL_REQUEST"
echo "sonar.pullrequest.key=$TRAVIS_PULL_REQUEST"
echo "sonar.pullrequest.branch=$SONAR_PULLREQUEST_BRANCH"
echo "sonar.pullrequest.base=$TRAVIS_BRANCH"
./gradlew sonarqube \
-Dsonar.organization=osmlab \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.junit.reportPaths=build/test-results/test \
-Dsonar.jacoco.reportPaths=build/jacoco/test.exec \
-Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST \
-Dsonar.pullrequest.branch=$SONAR_PULLREQUEST_BRANCH \
-Dsonar.pullrequest.base=$TRAVIS_BRANCH \
-Dsonar.pullrequest.provider=github \
-Dsonar.pullrequest.github.repository=osmlab/atlas-checks \
-Dsonar.pullrequest.github.endpoint=https://api.github.com/ \
-Dsonar.pullrequest.github.token.secured=$SONAR_PR_DECORATION_GITHUB_TOKEN
else
echo "Running sonarqube in a regular build"
./gradlew sonarqube \
-Dsonar.branch.name=$TRAVIS_BRANCH \
-Dsonar.organization=osmlab \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
id 'checkstyle'
id 'jacoco'
id "com.diffplug.gradle.spotless" version "3.4.0"
id 'org.sonarqube' version '2.6'
id 'org.sonarqube' version '2.6.2'
// id "io.codearte.nexus-staging" version "0.12.0"
id 'com.github.johnrengelman.shadow' version '1.2.4'
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Oct 19 14:21:17 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip

0 comments on commit 2fd747b

Please sign in to comment.