aboutsummaryrefslogtreecommitdiffstats
path: root/.cirrus/cirrus-sq-analysis.sh
diff options
context:
space:
mode:
Diffstat (limited to '.cirrus/cirrus-sq-analysis.sh')
-rwxr-xr-x.cirrus/cirrus-sq-analysis.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/.cirrus/cirrus-sq-analysis.sh b/.cirrus/cirrus-sq-analysis.sh
new file mode 100755
index 00000000000..cfc020cc25d
--- /dev/null
+++ b/.cirrus/cirrus-sq-analysis.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -euo pipefail
+
+source .cirrus/cirrus-env
+
+: "${SONAR_HOST_URL?}" "${SONAR_TOKEN?}"
+
+git fetch --unshallow || true
+if [ -n "${GITHUB_BASE_BRANCH:-}" ]; then
+ git fetch origin "${GITHUB_BASE_BRANCH}"
+fi
+
+./gradlew sonar \
+ -DbuildNumber="$BUILD_NUMBER" \
+ -Dsonar.projectKey=sonarqube \
+ -Dsonar.host.url="$SONAR_HOST_URL" \
+ -Dsonar.token="$SONAR_TOKEN" \
+ -Dsonar.analysis.buildNumber="$BUILD_NUMBER" \
+ -Dsonar.analysis.pipeline="$PIPELINE_ID" \
+ -Dsonar.analysis.repository="$GITHUB_REPO" \
+ -Dsonar.analysis.sha1="$GIT_SHA1" \
+ --parallel --configure-on-demand --console plain -Pqa