From a0267b1cef9841a090d4d8cde293e23c50af5d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Wed, 20 Sep 2023 21:00:49 +0200 Subject: [PATCH] Move sonarqube scan to github workflow --- .circleci/config.yml | 14 -------------- .github/workflows/ci.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec3bc5b5..bf962f18 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,19 +6,6 @@ aliases: command: | echo "export JFROG_USER=$ARTIFACTORY_USER" >> $BASH_ENV echo "export JFROG_PASS=$ARTIFACTORY_PASSWORD" >> $BASH_ENV - - &sonar-scan - name: Sonar scan - command: | - mvn -s .circleci/settings.xml \ - org.jacoco:jacoco-maven-plugin:prepare-agent verify \ - org.jacoco:jacoco-maven-plugin:report sonar:sonar \ - -Dmaven.main.skip \ - -DskipTests \ - -Dsonar.projectKey=entur_${CIRCLE_PROJECT_REPONAME} \ - -Dsonar.organization=${SONAR_ORG} \ - -Dsonar.projectName=${CIRCLE_PROJECT_REPONAME} \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=${ENTUR_SONAR_PASSWORD} - &post_build name: Trigger downstream builds command: | @@ -58,7 +45,6 @@ jobs: - run: name: Run Maven verify command: mvn verify -s .circleci/settings.xml -Dprettier.nodePath=node -Dprettier.npmPath=npm - - run: *sonar-scan - run: name: Save test results command: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee5c5937..fb4c4476 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,18 @@ jobs: mvn --batch-mode jacoco:prepare-agent test jacoco:report -Dprettier.nodePath=node -Dprettier.npmPath=npm mvn --batch-mode jib:dockerBuild -Dmaven.test.skip -P prettierSkip + - name: SonarQube Scan + run: | + mvn \ + org.jacoco:jacoco-maven-plugin:prepare-agent verify \ + org.jacoco:jacoco-maven-plugin:report sonar:sonar \ + -Dmaven.main.skip \ + -DskipTests \ + -Dsonar.projectKey=entur_lamassu \ + -Dsonar.organization=enturas-github \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login=${{ secrets.ENTUR_SONAR_PASSWORD }} + image: # only build and push the image when it's a commit to master in Entur's repository if: github.repository_owner == 'entur' && github.event_name == 'push'