Skip to content

Commit ee38162

Browse files
committed
SONARXML-252 Unify Platform Dogfooding of sonar-xml
1 parent 29fc3da commit ee38162

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.cirrus.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ only_sonarsource_qa: &ONLY_SONARSOURCE_QA
4444
log_develocity_url_script: &log_develocity_url_script |
4545
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"
4646

47+
sonar_shadow_scan_script: &sonar_shadow_scan_script |
48+
source cirrus-env BUILD
49+
. set_maven_build_version "$BUILD_NUMBER"
50+
mvn \
51+
-Pcoverage \
52+
-Dmaven.test.redirectTestOutputToFile=false \
53+
-Dsonar.host.url="$SONAR_HOST_URL" \
54+
-Dsonar.token="$SONAR_TOKEN" \
55+
-Dsonar.organization=sonarsource \
56+
-Dsonar.projectKey=SonarSource_sonar-xml \
57+
-Dsonar.analysis.buildNumber="$BUILD_NUMBER" \
58+
-Dsonar.analysis.repository="$GITHUB_REPO" \
59+
--batch-mode --errors --show-version \
60+
verify sonar:sonar
61+
4762
build_task:
4863
eks_container:
4964
<<: *CONTAINER_DEFINITION
@@ -65,6 +80,44 @@ build_task:
6580
- regular_mvn_build_deploy_analyze
6681
cleanup_before_cache_script: cleanup_maven_repository
6782

83+
sonar_shadow_scan_sqc_eu_task:
84+
depends_on:
85+
- build
86+
# Only run when triggered by the cirrus-ci cron job named "nightly"
87+
#TODO only_if: $CIRRUS_CRON == "nightly"
88+
eks_container:
89+
<<: *CONTAINER_DEFINITION
90+
cpu: 2
91+
memory: 2G
92+
env:
93+
SONAR_TOKEN: VAULT[development/kv/data/sonarcloud data.token]
94+
SONAR_HOST_URL: "https://sonarcloud.io"
95+
maven_cache:
96+
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
97+
build_script:
98+
- *log_develocity_url_script
99+
- *sonar_shadow_scan_script
100+
cleanup_before_cache_script: cleanup_maven_repository
101+
102+
sonar_shadow_scan_sqc_us_task:
103+
depends_on:
104+
- build
105+
# Only run when triggered by the cirrus-ci cron job named "nightly"
106+
#TODO only_if: $CIRRUS_CRON == "nightly"
107+
eks_container:
108+
<<: *CONTAINER_DEFINITION
109+
cpu: 2
110+
memory: 2G
111+
env:
112+
SONAR_TOKEN: VAULT[development/kv/data/sonarqube-us data.token]
113+
SONAR_HOST_URL: "https://sonarqube.us"
114+
maven_cache:
115+
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
116+
build_script:
117+
- *log_develocity_url_script
118+
- *sonar_shadow_scan_script
119+
cleanup_before_cache_script: cleanup_maven_repository
120+
68121
ws_scan_task:
69122
depends_on:
70123
- build
@@ -159,6 +212,8 @@ ruling_win_task:
159212
promote_task:
160213
depends_on:
161214
- build
215+
- sonar_shadow_scan_sqc_eu_task
216+
- sonar_shadow_scan_sqc_us_task
162217
- build_win
163218
- ruling
164219
- ruling_win

0 commit comments

Comments
 (0)