File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 1414 ARTIFACTORY_ACCESS_TOKEN : VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
1515 DEVELOCITY_TOKEN : VAULT[development/kv/data/develocity data.token]
1616 DEVELOCITY_ACCESS_KEY : develocity.sonar.build=${DEVELOCITY_TOKEN}
17- SONAR_PROJECT_KEY : " org.sonarsource.xml:xml"
1817 # Use bash (instead of sh on linux or cmd.exe on windows)
1918 CIRRUS_SHELL : bash
2019
@@ -76,6 +75,7 @@ sonar_shadow_scan_and_issue_replication_task:
7675 cpu : 2
7776 memory : 2G
7877 env :
78+ SONAR_PROJECT_KEY : " org.sonarsource.xml:xml"
7979 SHADOW_ORGANIZATION : " sonarsource"
8080 SHADOW_PROJECT_KEY : " SonarSource_sonar-xml"
8181 # to replicate issue states from next
@@ -90,8 +90,9 @@ sonar_shadow_scan_and_issue_replication_task:
9090 SHADOW_SONAR_HOST_URL : " https://sonarqube.us"
9191 maven_cache :
9292 folder : ${CIRRUS_WORKING_DIR}/.m2/repository
93- build_script :
93+ build_and_shadow_scan_script :
9494 - *log_develocity_url_script
95+ - source cirrus-env BUILD
9596 - ./shadow-scan-and-issue-replication.sh
9697 cleanup_before_cache_script : cleanup_maven_repository
9798
Original file line number Diff line number Diff line change @@ -9,17 +9,22 @@ IRIS_JAR_PATH="target/libs/iris.jar"
99function build_and_analyze_the_project() {
1010 echo
1111 echo " ===== Build and analyze the project targeting a shadow SonarQube instance"
12- mvn \
13- -Pcoverage \
14- -Dmaven.test.redirectTestOutputToFile=false \
12+ local BUILD_CMD
13+ if [[ -e " gradlew" ]]; then
14+ BUILD_CMD=" ./gradlew --info --stacktrace --console plain build sonar"
15+ else
16+ source set_maven_build_version " $BUILD_NUMBER "
17+ BUILD_CMD=" mvn -Pcoverage -Dmaven.test.redirectTestOutputToFile=false --batch-mode --errors --show-version verify sonar:sonar"
18+ fi
19+ ${BUILD_CMD} \
20+ -DbuildNumber=" ${BUILD_NUMBER} " \
1521 -Dsonar.host.url=" ${SHADOW_SONAR_HOST_URL} " \
1622 -Dsonar.token=" ${SHADOW_SONAR_TOKEN} " \
1723 -Dsonar.organization=" ${SHADOW_ORGANIZATION} " \
1824 -Dsonar.projectKey=" ${SHADOW_PROJECT_KEY} " \
1925 -Dsonar.analysis.buildNumber=" ${BUILD_NUMBER} " \
2026 -Dsonar.analysis.repository=" ${GITHUB_REPO} " \
21- --batch-mode --errors --show-version \
22- verify sonar:sonar
27+ " $@ "
2328}
2429
2530function download_iris() {
@@ -63,8 +68,6 @@ function run_iris_with_and_without_dry_run() {
6368 fi
6469}
6570
66- source cirrus-env BUILD
67- . set_maven_build_version " $BUILD_NUMBER "
68- build_and_analyze_the_project
71+ build_and_analyze_the_project " $@ "
6972download_iris
7073run_iris_with_and_without_dry_run
You can’t perform that action at this time.
0 commit comments