Skip to content

Commit 078d291

Browse files
committed
SCANPY-197 Fix weird region support for sonarqube.us
1 parent dff83c5 commit 078d291

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.cirrus/analysis.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,27 @@
22

33
function run_analysis {
44
# extra analysis parameters are set in the 'sonar-project.properties'
5-
pysonar \
6-
-Dsonar.host.url="$SONAR_HOST_URL" \
7-
-Dsonar.token="$SONAR_TOKEN" \
8-
-Dsonar.analysis.buildNumber=$CI_BUILD_NUMBER \
9-
-Dsonar.analysis.pipeline="$PIPELINE_ID" \
10-
-Dsonar.analysis.sha1="$GIT_SHA1" \
11-
-Dsonar.analysis.repository="$GITHUB_REPO" \
12-
"$@"
5+
if [ "$SONAR_HOST_URL" == "https://sonarqube.us" ]; then
6+
# deal with strange SonarQube configuration for the US region
7+
pysonar \
8+
-Dsonar.host.url="$SONAR_HOST_URL" \
9+
-Dsonar.region=us \
10+
-Dsonar.token="$SONAR_TOKEN" \
11+
-Dsonar.analysis.buildNumber=$CI_BUILD_NUMBER \
12+
-Dsonar.analysis.pipeline="$PIPELINE_ID" \
13+
-Dsonar.analysis.sha1="$GIT_SHA1" \
14+
-Dsonar.analysis.repository="$GITHUB_REPO" \
15+
"$@"
16+
else
17+
pysonar \
18+
-Dsonar.host.url="$SONAR_HOST_URL" \
19+
-Dsonar.token="$SONAR_TOKEN" \
20+
-Dsonar.analysis.buildNumber=$CI_BUILD_NUMBER \
21+
-Dsonar.analysis.pipeline="$PIPELINE_ID" \
22+
-Dsonar.analysis.sha1="$GIT_SHA1" \
23+
-Dsonar.analysis.repository="$GITHUB_REPO" \
24+
"$@"
25+
fi
1326
}
1427

1528
# generic environment variables

0 commit comments

Comments
 (0)