-
Notifications
You must be signed in to change notification settings - Fork 3
/
sonar-ci.yml
23 lines (22 loc) · 992 Bytes
/
sonar-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
variables:
SONAR_SCANNER_EXTRA_ARGS: ''
SONAR_PROJECT_KEY: ${PROJECT_KEY}
SONAR_PROJECT_VERSION: ${CI_COMMIT_REF_NAME}
SONAR_WAIT_QUALITY_GATE: 'true'
.sonar:sonar-scanner:
image:
name: docker.io/sonarsource/sonar-scanner-cli:5.0.1
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH: "0"
JAVA_TOOL_OPTIONS: "-Dhttps.proxyHost=$PROXY_HOST -Dhttps.proxyPort=$PROXY_PORT"
script:
- apk add coreutils
- |
if [ ! -z $CA_BUNDLE ]; then
cat $CA_BUNDLE >> /tmp/additional-ca-cert-bundle.pem
csplit -s -z -f /tmp/cert- /tmp/additional-ca-cert-bundle.pem '/-----BEGIN CERTIFICATE-----/' '{*}'
for f in /tmp/cert-*; do keytool -noprompt -importcert -cacerts -alias $f -file $f -storepass changeit; done
fi
- sonar-scanner -Dsonar.qualitygate.wait=${SONAR_WAIT_QUALITY_GATE} -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.projectVersion=${SONAR_PROJECT_VERSION} $SONAR_SCANNER_EXTRA_ARGS