Skip to content

Commit 3ec3491

Browse files
Wohopssonartech
authored andcommitted
SONARPY-3096 Enable shadow analysis on SQC-EU/US (#327)
GitOrigin-RevId: f45d62343c5194762dff05bbc5b68e85464aa9d2
1 parent 80fa0b6 commit 3ec3491

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

.cirrus-public.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
CIRRUS_SHELL: bash
1212
DEPLOY_PULL_REQUEST: false
1313
IS_COMMUNITY: true
14+
CRON_NIGHTLY_JOB_NAME: "nightly"
1415

1516
build_container_definition: &BUILD_CONTAINER_DEFINITION
1617
eks_container:
@@ -29,13 +30,10 @@ build_container_definition: &BUILD_CONTAINER_DEFINITION
2930
only_sonarsource_qa: &ONLY_SONARSOURCE_QA
3031
only_if: $LOCAL == "1" || ($CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BUILD_SOURCE == 'api' || $CIRRUS_BRANCH =~ "dogfood-on-.*"))
3132

32-
test_analyze_task:
33+
base_analysis_task: &BASE_ANALYSIS
3334
<<: *BUILD_CONTAINER_DEFINITION
3435
<<: *ONLY_SONARSOURCE_QA
3536
env:
36-
# analysis on next
37-
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
38-
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
3937
CIRRUS_CLONE_DEPTH: 50
4038
maven_cache:
4139
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
@@ -47,5 +45,31 @@ test_analyze_task:
4745
analyze_script:
4846
- rm -rf private
4947
- source cirrus-env BUILD
50-
- PULL_REQUEST_SHA=$GIT_SHA1 ./.cirrus/test_analyze.sh
48+
- PULL_REQUEST_SHA=$GIT_SHA1 ./.cirrus/analyze.sh
5149
cleanup_before_cache_script: cleanup_maven_repository
50+
51+
analysis_next_task:
52+
<<: *BASE_ANALYSIS
53+
name: "Analysis on SonarQube NEXT"
54+
alias: analysis_next
55+
env:
56+
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
57+
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
58+
59+
analysis_sqc_eu_shadow_task:
60+
<<: *BASE_ANALYSIS
61+
name: "Analysis on Sonarcloud.io"
62+
alias: analysis_sqc_eu_shadow
63+
only_if: $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
64+
env:
65+
SONAR_TOKEN: VAULT[development/kv/data/sonarcloud data.token]
66+
SONAR_HOST_URL: https://sonarcloud.io
67+
68+
analysis_sqc_us_shadow_task:
69+
<<: *BASE_ANALYSIS
70+
name: "Analysis on SonarQube.us"
71+
alias: analysis_sqc_us_shadow
72+
only_if: $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
73+
env:
74+
SONAR_TOKEN: VAULT[development/kv/data/sonarqube-us data.token]
75+
SONAR_HOST_URL: https://sonarqube.us
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function run_maven {
77
-Dmaven.test.redirectTestOutputToFile=false \
88
-Dsonar.host.url="$SONAR_HOST_URL" \
99
-Dsonar.token="$SONAR_TOKEN" \
10+
-Dsonar.organization="sonarsource" \
1011
-Dsonar.analysis.buildNumber="$BUILD_NUMBER" \
1112
-Dsonar.analysis.pipeline="$PIPELINE_ID" \
1213
-Dsonar.analysis.sha1="$GIT_SHA1" \

0 commit comments

Comments
 (0)