]> source.dussan.org Git - sonarqube.git/commitdiff
Add comments to Travis PR analysis
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 5 Nov 2015 09:14:31 +0000 (10:14 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 5 Nov 2015 09:14:31 +0000 (10:14 +0100)
travis.sh

index 12e6ad9d772530f6f206f9295389fa93c3dde2bb..e3e91d99eda5932df5de0a760eaa9d7547f939c3 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -40,13 +40,18 @@ set +eu
   ;;
 
 PRANALYSIS)
-  export JAVA_HOME=/usr/lib/jvm/java-8-oracle
-  export PATH=$JAVA_HOME/bin:$PATH
-  java -Xmx32m -version
-  javac -J-Xmx32m -version
   if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
+
+      # For security reasons environment variables are not available on the pull requests
+      # coming from outside repositories
+      # http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests
          if [ -n "$SONAR_GITHUB_OAUTH" ]; then
-           echo "Start pullrequest analysis"
+
+           # Switch to java 8 as the Dory HTTPS certificate is not supported by Java 7
+        export JAVA_HOME=/usr/lib/jvm/java-8-oracle
+        export PATH=$JAVA_HOME/bin:$PATH
+
+           echo "Analyze pull request"
            mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -B -e -V -Panalysis \
             -Dmaven.test.failure.ignore=true \
             -Dclirr=true \
@@ -59,10 +64,8 @@ PRANALYSIS)
             -Dsonar.login=$SONAR_LOGIN \
             -Dsonar.password=$SONAR_PASSWD
          else
-               echo "No oauth token available"
+               echo "Pull requests are not analyzed when coming from outside repositories"
          fi
-  else
-       echo "Not in a pull request"
   fi
   ;;