Add sonarqube for PRs (#755)
* Add sonarqube for PRs Signed-off-by: Jeroen Laverman <jeroen.laverman@bosch-si.com> * fix path to script Signed-off-by: Jeroen Laverman <jeroen.laverman@bosch-si.com> * Rename Token Signed-off-by: Jeroen Laverman <jeroen.laverman@bosch-si.com> * fix script Signed-off-by: Jeroen Laverman <jeroen.laverman@bosch-si.com>
This commit is contained in:
committed by
Dominic Schabel
parent
f40f388158
commit
bcdfed8511
@@ -37,7 +37,7 @@ jobs:
|
|||||||
# Run tests
|
# Run tests
|
||||||
- run:
|
- run:
|
||||||
name: Test incl. license verification
|
name: Test incl. license verification
|
||||||
command: mvn verify license:check
|
command: './.circleci/sonarCircleCi.sh'
|
||||||
|
|
||||||
# Record test results
|
# Record test results
|
||||||
- run: mkdir -p testresults/junit/
|
- run: mkdir -p testresults/junit/
|
||||||
|
|||||||
24
.circleci/sonarCircleCi.sh
Normal file → Executable file
24
.circleci/sonarCircleCi.sh
Normal file → Executable file
@@ -8,23 +8,11 @@
|
|||||||
# http://www.eclipse.org/legal/epl-v10.html
|
# http://www.eclipse.org/legal/epl-v10.html
|
||||||
#
|
#
|
||||||
|
|
||||||
echo $CI_PULL_REQUEST pull request
|
#echo "$CIRCLE_PULL_REQUEST pull request"
|
||||||
# regular sonar on master
|
|
||||||
if [ "$CIRCLE_BRANCH" = "master" ]; then
|
# Run SonarQube only for master branch
|
||||||
mvn verify license:check sonar:sonar -Dsonar.login=$SONAR_SERVER_TOKEN
|
if [ $CIRCLE_BRANCH = master ] ; then
|
||||||
# preview in case of pull request - disabled as circle does not fill those with pull reuqests from different directories
|
mvn verify license:check sonar:sonar -Dsonar.login=$SONAR_ACCESS_TOKEN --batch-mode
|
||||||
else
|
else
|
||||||
#if [ -n "$CI_PULL_REQUEST" ]; then
|
mvn verify license:check --batch-mode
|
||||||
# mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify license:check sonar:sonar -B -e -V \
|
|
||||||
# -Dclirr=true \
|
|
||||||
# -Dsonar.analysis.mode=issues \
|
|
||||||
# -Dsonar.github.pullRequest=`echo $CI_PULL_REQUEST| awk -F'/' '{print $7}'` \
|
|
||||||
# -Dsonar.github.login=$SONAR_GITHUB_LOGIN \
|
|
||||||
# -Dsonar.github.oauth=$SONAR_GITHUB_OAUTH \
|
|
||||||
# -Dsonar.login=$SONAR_SERVER_USER \
|
|
||||||
# -Dsonar.password=$SONAR_SERVER_PASSWD
|
|
||||||
#else
|
|
||||||
mvn verify license:check
|
|
||||||
#fi
|
|
||||||
fi
|
fi
|
||||||
# but noting in case of other branches
|
|
||||||
|
|||||||
Reference in New Issue
Block a user