-
-
Save prashanth-sams/fc30d76c51fca1d1c0a2fa839e8bf86b to your computer and use it in GitHub Desktop.
Run sonarqube analysis on travis via docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ev | |
if [ -v SONAR_TOKEN ]; then | |
docker pull pierrevincent/sonar-runner | |
SONAR_OPTIONS="-Dsonar.login=$SONAR_TOKEN" | |
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then | |
SONAR_OPTIONS="$SONAR_OPTIONS -Dsonar.github.oauth=$SONAR_GITHUB -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST -Dsonar.analysis.mode=issues" | |
fi | |
docker run --rm -v $(pwd):/data pierrevincent/sonar-runner $SONAR_OPTIONS | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment