ci: collect sonar coverage in go container
This commit is contained in:
parent
c84bb14771
commit
2affec9bbd
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -97,14 +97,22 @@ spec:
|
||||
|
||||
stage('Collect SonarQube evidence') {
|
||||
steps {
|
||||
container('quality-tools') {
|
||||
container('go-tester') {
|
||||
sh '''#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
mkdir -p build
|
||||
export GOFLAGS='-buildvcs=false'
|
||||
if [ ! -s build/coverage.out ]; then
|
||||
go test ./... -coverprofile=build/coverage.out
|
||||
fi
|
||||
set +e
|
||||
go test ./... -coverprofile=build/coverage.out
|
||||
coverage_rc=$?
|
||||
set -e
|
||||
printf '%s\n' "${coverage_rc}" > build/sonarqube-coverage.rc
|
||||
'''
|
||||
}
|
||||
container('quality-tools') {
|
||||
sh '''#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
mkdir -p build
|
||||
args=(
|
||||
"-Dsonar.host.url=${SONARQUBE_HOST_URL}"
|
||||
"-Dsonar.login=${SONARQUBE_TOKEN}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user