aboutsummaryrefslogtreecommitdiffstats
path: root/.cirrus/cirrus-sq-analysis.sh
blob: 01d1cf49dfb17d8c815f59166f76033089d93a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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" \
  -Dsonar.exclusions=**/design-system/src/theme/** \
  --parallel --configure-on-demand --console plain -Pqa