mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 14:55:51 +00:00
Updated Jenkins Sonar
Updated Jenkins Sonar
This commit is contained in:
parent
a076a429e3
commit
5ff9a835b4
1 changed files with 25 additions and 11 deletions
36
jenkinsfile
36
jenkinsfile
|
@ -8,6 +8,31 @@ node {
|
||||||
// ** in the global configuration.
|
// ** in the global configuration.
|
||||||
mvnHome = tool 'M3'
|
mvnHome = tool 'M3'
|
||||||
}
|
}
|
||||||
|
stage('Sonar Scan Execution'){
|
||||||
|
//Run the sonar scan
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
mvnHome = tool 'M3'
|
||||||
|
withSonarQubeDev{
|
||||||
|
sh "'${mvnHome}/bin/mvn' verify sonar:sonar -Dintegration-tests.skip=true -Dmaven.test.failure.ignore=true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Sonar scan result check') {
|
||||||
|
steps {
|
||||||
|
timeout(time: 2, unit: 'MINUTES') {
|
||||||
|
retry(3) {
|
||||||
|
script {
|
||||||
|
def qg = waitForQualityGate()
|
||||||
|
if (qg.status != 'OK') {
|
||||||
|
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
// Run the maven build
|
// Run the maven build
|
||||||
withEnv(["MVN_HOME=$mvnHome"]) {
|
withEnv(["MVN_HOME=$mvnHome"]) {
|
||||||
|
@ -18,15 +43,4 @@ node {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Sonar Scan Execution'){
|
|
||||||
//Run the sonar scan
|
|
||||||
steps {
|
|
||||||
script{
|
|
||||||
def mvnHome = tool 'M3'
|
|
||||||
withSonarQubeDev{
|
|
||||||
sh "'${mvnHome}/bin/mvn' verify sonar:sonar -Dintegration-tests.skip=true -Dmaven.test.failure.ignore=true"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue