]> source.dussan.org Git - sonarqube.git/commitdiff
Propagate parameters of SQ analysis required by burgr
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 10 Oct 2017 15:43:16 +0000 (17:43 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 10 Oct 2017 15:43:16 +0000 (17:43 +0200)
travis.sh

index de9924b57d102066daddbb817427c7d9099302cd..58e2300e41f56f296e53e0fb1a20d8b9ba165bfd 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -105,7 +105,7 @@ function fixBuildVersion {
 #
 function configureTravis {
   mkdir -p ~/.local
-  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v36 | tar zx --strip-components 1 -C ~/.local
+  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v38 | tar zx --strip-components 1 -C ~/.local
   source ~/.local/bin/install
 }
 configureTravis
@@ -146,7 +146,11 @@ BUILD)
     mvn sonar:sonar \
           -Dsonar.host.url=$SONAR_HOST_URL \
           -Dsonar.login=$SONAR_TOKEN \
-          -Dsonar.projectVersion=$INITIAL_VERSION
+          -Dsonar.projectVersion=$INITIAL_VERSION \
+          -Dsonar.analysis.buildNumber=$TRAVIS_BUILD_NUMBER \
+          -Dsonar.analysis.pipeline=$TRAVIS_BUILD_NUMBER \
+          -Dsonar.analysis.sha1=$TRAVIS_COMMIT \
+          -Dsonar.analysis.repository=$TRAVIS_REPO_SLUG
 
   elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
     echo 'Build release branch'
@@ -159,7 +163,11 @@ BUILD)
         -Dsonar.host.url=$SONAR_HOST_URL \
         -Dsonar.login=$SONAR_TOKEN \
         -Dsonar.branch.name=$TRAVIS_BRANCH \
-        -Dsonar.projectVersion=$INITIAL_VERSION
+        -Dsonar.projectVersion=$INITIAL_VERSION \
+        -Dsonar.analysis.buildNumber=$TRAVIS_BUILD_NUMBER \
+        -Dsonar.analysis.pipeline=$TRAVIS_BUILD_NUMBER \
+        -Dsonar.analysis.sha1=$TRAVIS_COMMIT \
+        -Dsonar.analysis.repository=$TRAVIS_REPO_SLUG
 
   elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
     echo 'Build and analyze internal pull request'
@@ -186,7 +194,11 @@ BUILD)
           -Dsonar.host.url=$SONAR_HOST_URL \
           -Dsonar.login=$SONAR_TOKEN \
           -Dsonar.branch.name=$TRAVIS_PULL_REQUEST_BRANCH \
-          -Dsonar.branch.target=$TRAVIS_BRANCH
+          -Dsonar.branch.target=$TRAVIS_BRANCH \
+          -Dsonar.analysis.buildNumber=$TRAVIS_BUILD_NUMBER \
+          -Dsonar.analysis.pipeline=$TRAVIS_BUILD_NUMBER \
+          -Dsonar.analysis.sha1=$TRAVIS_COMMIT \
+          -Dsonar.analysis.repository=$TRAVIS_REPO_SLUG
     fi
   else
     echo 'Build feature branch or external pull request'