File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -312,3 +312,23 @@ promote_task:
312
312
<< : *POETRY_INSTALL
313
313
<< : *POETRY_SET_VERSION
314
314
promote_script : cirrus_promote
315
+
316
+ run_iris_task :
317
+ depends_on :
318
+ - promote
319
+ << : *LINUX_CONTAINER_DEFINITION
320
+ # only executed in CRON job AND on master branch
321
+ only_if : $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
322
+ env :
323
+ SONAR_SOURCE_IRIS_TOKEN : VAULT[development/kv/data/iris data.next]
324
+ matrix :
325
+ - name : " IRIS SQ NEXT -> Sonarcloud.io"
326
+ env :
327
+ SONAR_TARGET_URL : https://sonarcloud.io
328
+ SONAR_TARGET_IRIS_TOKEN : VAULT[development/kv/data/iris data.sqc-eu]
329
+ - name : " IRIS SQ NEXT -> SonarQube.us"
330
+ env :
331
+ SONAR_TARGET_URL : https://sonarqube.us
332
+ SONAR_TARGET_IRIS_TOKEN : VAULT[development/kv/data/iris data.sqc-us]
333
+ script :
334
+ - .cirrus/run_iris.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+
4
+ : " ${ARTIFACTORY_PRIVATE_USERNAME?} " " ${ARTIFACTORY_PRIVATE_PASSWORD?} " " ${ARTIFACTORY_URL?} "
5
+ : " ${SONAR_SOURCE_IRIS_TOKEN?} " " ${SONAR_TARGET_IRIS_TOKEN?} " " ${SONAR_TARGET_URL?} "
6
+
7
+ function run_iris () {
8
+ java \
9
+ -Diris.source.projectKey=" SonarSource_sonar-scanner-python" \
10
+ -Diris.source.url=" https://next.sonarqube.com/sonarqube" \
11
+ -Diris.source.token=" $SONAR_SOURCE_IRIS_TOKEN " \
12
+ -Diris.destination.projectKey=" SonarSource_sonar-scanner-python" \
13
+ -Diris.destination.url=" $SONAR_TARGET_URL " \
14
+ -Diris.destination.token=" $SONAR_TARGET_IRIS_TOKEN " \
15
+ -Diris.destination.organization=" sonarsource" \
16
+ -Diris.dryrun=$1 \
17
+ -jar iris-\[ RELEASE\] -jar-with-dependencies.jar
18
+ }
19
+
20
+ VERSION=" \[RELEASE\]"
21
+ HTTP_CODE=$( \
22
+ curl \
23
+ --write-out ' %{http_code}' \
24
+ --location \
25
+ --remote-name \
26
+ --user " $ARTIFACTORY_PRIVATE_USERNAME :$ARTIFACTORY_PRIVATE_PASSWORD " \
27
+ " $ARTIFACTORY_URL /sonarsource-private-releases/com/sonarsource/iris/iris/$VERSION /iris-$VERSION -jar-with-dependencies.jar" \
28
+ )
29
+
30
+ if [ " $HTTP_CODE " != " 200" ]; then
31
+ echo " Download $VERSION failed -> $HTTP_CODE "
32
+ exit 1
33
+ else
34
+ echo " Downloaded $VERSION "
35
+ fi
36
+
37
+ echo " ===== Execute IRIS as dry-run"
38
+ run_iris " true"
39
+ STATUS=$?
40
+ if [ $STATUS -ne 0 ]; then
41
+ echo " ===== Failed to run IRIS dry-run"
42
+ exit 1
43
+ else
44
+ echo " ===== Successful IRIS dry-run - executing IRIS for real."
45
+ run_iris " false"
46
+ fi
You can’t perform that action at this time.
0 commit comments