diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-11-05 10:14:31 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-11-05 10:14:31 +0100 |
commit | 37dacbc893b0cf117028021aa72036cbc7823aab (patch) | |
tree | 63c39c052d1ac861a80f5df08000c09ea7b4a9cd /travis.sh | |
parent | 52c69fcd007fcad58f23bc80ffcab9b06326fb0a (diff) | |
download | sonarqube-37dacbc893b0cf117028021aa72036cbc7823aab.tar.gz sonarqube-37dacbc893b0cf117028021aa72036cbc7823aab.zip |
Add comments to Travis PR analysis
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/travis.sh b/travis.sh index 12e6ad9d772..e3e91d99eda 100755 --- 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 ;; |