For the below pipeline script:
stage('stage1'){
withSonarQubeEnv(server){
sh "${scannerHome}/bin/sonar-scanner"
}
}
stage1
launches Sonar scan and exit with success state.
stage2
waits for 30 minutes until sonar scan completes, jenkins is suppose to receive QualityGate status, as per below code.
stage('stage2'){
timeout(time: 40, unit: 'MINUTES') {
def qGate = waitForQualityGate()
if (qGate.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qGate.status}"
}
}
}
We have Sonar server and sonar scanner configured in Jenkins.
Is there additional configuration required to receive quality gate status?