Permalink
Browse files

Restrict sonarqube analysis to master branch

  • Loading branch information...
benfortuna committed Jun 29, 2016
1 parent 35b942e commit 3a562733b1db4f631c5fe4f2ae6b3906badf602e
Showing with 7 additions and 5 deletions.
  1. +7 −5 .travis.yml
View
@@ -3,17 +3,15 @@ jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
-before_script:
- - sudo keytool -import -alias sonar -keystore $JAVA_HOME/jre/lib/security/cacerts -file sonar_cert.pem -storepass changeit -noprompt
script:
- - ./gradlew check sonarqube
+ - ./gradlew check
deploy:
provider: releases
api_key:
secure: DpTp3xxZrKP21I13G8dYY5EBra5tcf9TsF1y9oLRdOSoVvUe0XaOQ+9WPG2RgnuH1DPVj1n2Rr6emAZ84lSzz4H7T8gPYP4pLjmJBGyriGC7N3MTG2FCBn5l6DgTKNLxtfpek/b7nClif6vVTEse/T8/9an/Yszp9bbIZNNwStE=
file:
- - build/distributions/ical4j-$RELEASE_VERSION.zip
- - build/distributions/ical4j-$RELEASE_VERSION.tgz
+ - build/distributions/ical4j-$TRAVIS_TAG.zip
+ - build/distributions/ical4j-$TRAVIS_TAG.tgz
skip_cleanup: true
on:
tags: true
@@ -22,3 +20,7 @@ before_deploy: "./gradlew assembleMainDist"
sudo: true
addons:
hostname: travis-ci
+after_script:
+ - sudo keytool -import -alias sonar -keystore $JAVA_HOME/jre/lib/security/cacerts -file sonar_cert.pem -storepass changeit -noprompt
+ # Check if commit is not a pull request, if git repo is official, and if branch is master. If checks pass, run Sonar reports
+ - "[[ $TRAVIS_PULL_REQUEST == false ]] && [[ $TRAVIS_REPO_SLUG == ical4j/ical4j ]] && [[ $TRAVIS_BRANCH == master ]] && ./gradlew sonarqube"

0 comments on commit 3a56273

Please sign in to comment.