]> source.dussan.org Git - sonarqube.git/commitdiff
BUILD-495 remove code duplication in build script
authorTom <thomas.verin@sonarsource.com>
Mon, 21 Aug 2017 08:51:41 +0000 (10:51 +0200)
committertomverin <thomas.verin@sonarsource.com>
Mon, 21 Aug 2017 12:02:01 +0000 (14:02 +0200)
travis.sh

index c1fb2fbf84bdd1a06f17df8477de9723f5837726..fa5336b652d72bdc4355a9f9e2c68a0cc443aaf8 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -141,18 +141,18 @@ BUILD)
     mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy \
           $MAVEN_ARGS \
           -Pdeploy-sonarsource,release
+        
+    INCREMENTAL=true          
+    # Triggers a full analysis for every build number ending with 0
     if [[ "$TRAVIS_BUILD_NUMBER" == *0 ]]; then
-      mvn sonar:sonar \
-          -Dsonar.host.url=$SONAR_HOST_URL \
-          -Dsonar.login=$SONAR_TOKEN \
-          -Dsonar.projectVersion=$INITIAL_VERSION
-    else
-      mvn sonar:sonar \
-          -Dsonar.incremental=true \
+      INCREMENTAL=false
+    fi
+
+    mvn sonar:sonar \
+          -Dsonar.incremental=$INCREMENTAL \
           -Dsonar.host.url=$SONAR_HOST_URL \
           -Dsonar.login=$SONAR_TOKEN \
           -Dsonar.projectVersion=$INITIAL_VERSION
-    fi
 
   elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
     echo 'Build release branch'