mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 14:55:51 +00:00
Sonar
Sonar
This commit is contained in:
parent
f54eeb1fb9
commit
69cf2b4ff7
1 changed files with 9 additions and 19 deletions
28
jenkinsfile
28
jenkinsfile
|
@ -8,30 +8,20 @@ node {
|
|||
// ** in the global configuration.
|
||||
mvnHome = tool 'M3'
|
||||
}
|
||||
stage('Sonar Scan Execution'){
|
||||
stage('Sonar Quality Analysis'){
|
||||
//Run the sonar scan
|
||||
steps {
|
||||
script{
|
||||
mvnHome = tool 'M3'
|
||||
withSonarQubeDev{
|
||||
sh "'${mvnHome}/bin/mvn' verify sonar:sonar -Dsonar.projectKey=Petclinic -Dsonar.host.url=http://xyart81442dns1.eastus2.cloudapp.azure.com -Dsonar.login=bff9e0e153a1384234a2c18652327736550c1ecd-Dintegration-tests.skip=true -Dmaven.test.failure.ignore=true"
|
||||
}
|
||||
}
|
||||
withSonarQubeDev{
|
||||
sh "'${mvnHome}/bin/mvn' verify sonar:sonar -Dsonar.projectKey=Petclinic -Dsonar.host.url=http://xyart81442dns1.eastus2.cloudapp.azure.com -Dsonar.login=bff9e0e153a1384234a2c18652327736550c1ecd-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('Sonar Quality Gate') {
|
||||
timeout(time: 1, unit: 'HOURS') {
|
||||
def qg = waitForQualityGate()
|
||||
if (qg.status != 'OK') {
|
||||
currentBuild.status='FAILURE'
|
||||
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
// Run the maven build
|
||||
|
|
Loading…
Reference in a new issue