forked from ExchangeBC/devex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.sonar
More file actions
21 lines (19 loc) · 818 Bytes
/
Jenkinsfile.sonar
File metadata and controls
21 lines (19 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
node('maven') {
stage('checkout') {
echo "checking out source"
echo "Build: ${BUILD_ID}"
checkout scm
}
stage('code quality check') {
SONARQUBE_PWD = sh (
script: 'oc env dc/sonarqube --list | awk -F "=" \'/SONARQUBE_ADMINPW/{print $2}\'',
returnStdout: true).trim()
SONARQUBE_URL = sh (
script: 'oc get routes -o wide --no-headers | awk \'/sonarqube/{ print match($0,/edge/) ? "https://"$2 : "http://"$2 }\'',
returnStdout: true).trim()
echo "SONARQUBE_URL: ${SONARQUBE_URL}"
dir('sonar-runner') {
sh returnStdout: true, script: "./gradlew sonarqube -Dsonar.host.url=${SONARQUBE_URL} -Dsonar.verbose=true --stacktrace --info -Dsonar.sources=.."
}
}
}