Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

Commit

Permalink
Merge pull request #399 from ContainerSolutions/build/removal-of-jenkins
Browse files Browse the repository at this point in the history
Removal of Jenkins
  • Loading branch information
remmelt committed Apr 21, 2016
2 parents e84847f + a47cc79 commit c3ca886
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ GH_SONARQ_PARAMS=""

# When run on Travis CI, env var TRAVIS_PULL_REQUEST either contains PR number (for PR builds) or "false" (for push builds).
# Locally this env var is not set. Test: if variable is not empty and is not equal "false"
if [ ! -z "$TRAVIS_PULL_REQUEST" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
if [ ! -z "$TRAVIS_PULL_REQUEST" ] && [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${TRAVIS_SECURE_ENV_VARS}" == "true" ]; then
echo "PR build. Will execute SonarQube preview scan"
GH_SONARQ_PARAMS="jacocoTestReport sonarqube -Dsonar.analysis.mode=preview -Dsonar.host.url=$SQ_URL -Dsonar.github.oauth=$GH_TOKEN -Dsonar.github.repository=$TRAVIS_REPO_SLUG -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST"
fi

# Update SonarQube data on push builds on master branch
if [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_SECURE_ENV_VARS}" == "true" ]; then
echo "Building $TRAVIS_BRANCH branch. Will execute SonarQube scan"
GH_SONARQ_PARAMS="jacocoTestReport sonarqube -Dsonar.host.url=$SQ_URL -Dsonar.jdbc.url=$SQ_JDBC_URL -Dsonar.jdbc.driverClassName=org.postgresql.Driver -Dsonar.jdbc.user=$SQ_JDBC_USER -Dsonar.jdbc.password=$SQ_JDBC_PASSWORD"
fi

./gradlew --info --stacktrace clean build $GH_SONARQ_PARAMS

0 comments on commit c3ca886

Please sign in to comment.