From 58cd28f9bb901c010c5513672591b8ee0b8a8d09 Mon Sep 17 00:00:00 2001 From: Amanda <31416491+at669@users.noreply.github.com> Date: Mon, 13 Dec 2021 11:51:39 -0800 Subject: [PATCH] AIRO-1561 Add Sonarqube (#118) * Sonarqube initial commit * Change branch trigger * Fix typo * Switch unit test trigger * Switch to prod key --- .yamato/sonar.yml | 17 +++++++++++++++++ .yamato/yamato-config.yml | 2 +- CHANGELOG.md | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .yamato/sonar.yml diff --git a/.yamato/sonar.yml b/.yamato/sonar.yml new file mode 100644 index 0000000..6ade886 --- /dev/null +++ b/.yamato/sonar.yml @@ -0,0 +1,17 @@ +name: Sonarqube Standard Scan +agent: + type: Unity::metal::macmini + image: package-ci/mac + flavor: m1.mac +variables: + SONARQUBE_PROJECT_KEY: ai-robotics-endpoint-ros +commands: + - curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-macosx.zip -o sonar-scanner-macosx.zip -L + - unzip sonar-scanner-macosx.zip -d ~/sonar-scanner + - ~/sonar-scanner/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner -Dsonar.projectKey=$SONARQUBE_PROJECT_KEY -Dsonar.sources=. -Dsonar.host.url=$SONARQUBE_ENDPOINT_URL_PRD -Dsonar.login=$SONARQUBE_TOKEN_PRD +triggers: + cancel_old_ci: true + expression: | + ((pull_request.target eq "main" OR pull_request.target eq "dev-ros") + AND NOT pull_request.push.changes.all match "**/*.md") OR + (push.branch eq "main" OR push.branch eq "dev-ros") \ No newline at end of file diff --git a/.yamato/yamato-config.yml b/.yamato/yamato-config.yml index f55245c..fd3165d 100644 --- a/.yamato/yamato-config.yml +++ b/.yamato/yamato-config.yml @@ -24,7 +24,7 @@ commands: triggers: cancel_old_ci: true expression: | - (pull_request.target eq "main" OR push.branch eq "main" OR pull_request.target eq "dev" OR push.branch eq "dev") + (pull_request.target eq "main" OR push.branch eq "main" OR pull_request.target eq "dev-ros" OR push.branch eq "dev-ros") AND NOT pull_request.push.changes.all match "**/*.md" artifacts: logs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6869c9d..ce2e4a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added +Added Sonarqube Scanner + ### Changed ### Deprecated