Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move sonarqube scan to github workflow #268

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down