diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a30b2071..139f38e4d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ jobs: # Run tests - run: name: Test incl. license verification - command: mvn verify license:check + command: './.circleci/sonarCircleCi.sh' # Record test results - run: mkdir -p testresults/junit/ diff --git a/.circleci/sonarCircleCi.sh b/.circleci/sonarCircleCi.sh old mode 100644 new mode 100755 index 066bda912..11cae82f7 --- a/.circleci/sonarCircleCi.sh +++ b/.circleci/sonarCircleCi.sh @@ -8,23 +8,11 @@ # http://www.eclipse.org/legal/epl-v10.html # -echo $CI_PULL_REQUEST pull request -# regular sonar on master -if [ "$CIRCLE_BRANCH" = "master" ]; then - mvn verify license:check sonar:sonar -Dsonar.login=$SONAR_SERVER_TOKEN -# preview in case of pull request - disabled as circle does not fill those with pull reuqests from different directories +#echo "$CIRCLE_PULL_REQUEST pull request" + +# Run SonarQube only for master branch +if [ $CIRCLE_BRANCH = master ] ; then + mvn verify license:check sonar:sonar -Dsonar.login=$SONAR_ACCESS_TOKEN --batch-mode else - #if [ -n "$CI_PULL_REQUEST" ]; then - # 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 + mvn verify license:check --batch-mode fi -# but noting in case of other branches