mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 05:55:51 +00:00
Updated the logic to allow for different allowable statuses from the SonarQube quality gate.
This commit is contained in:
parent
349eb685e0
commit
08601fc8e9
1 changed files with 8 additions and 1 deletions
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
|
@ -32,8 +32,15 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
timeout(time: 1, unit: 'HOURS') {
|
timeout(time: 1, unit: 'HOURS') {
|
||||||
script {
|
script {
|
||||||
|
// these are the statuses that we'll allow
|
||||||
|
def alowableStatuses = ['OK','WARN']
|
||||||
|
|
||||||
|
// we need to wait for the quality check to complete
|
||||||
def qg = waitForQualityGate()
|
def qg = waitForQualityGate()
|
||||||
if (qg.status != 'OK') {
|
|
||||||
|
// if the status we got back, isn't one of the logal ones, then
|
||||||
|
// we need o fail the build
|
||||||
|
if (!allowableStatuses.contains(qg.status)) {
|
||||||
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue