Commented Sonar

Commented Sonar
This commit is contained in:
sandeepds 2019-08-26 17:01:33 +05:30 committed by GitHub
parent 114e44ffab
commit 25b17dc4d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,21 +9,21 @@ node {
// ** in the global configuration. // ** in the global configuration.
mvnHome = tool 'M3' mvnHome = tool 'M3'
} }
stage('Sonar Quality Analysis'){ //stage('Sonar Quality Analysis'){
//Run the sonar scan //Run the sonar scan
withSonarQubeEnv('sonarqube'){ //withSonarQubeEnv('sonarqube'){
sh 'mvn clean package sonar:sonar' //sh 'mvn clean package sonar:sonar'
} //}
} //}
stage('Sonar Quality Gate') { //stage('Sonar Quality Gate') {
timeout(time: 2, unit: 'MINUTES') { //timeout(time: 2, unit: 'MINUTES') {
def qg = waitForQualityGate() //def qg = waitForQualityGate()
if (qg.status != 'OK') { //if (qg.status != 'OK') {
currentBuild.status='FAILURE' //currentBuild.status='FAILURE'
error "Pipeline aborted due to quality gate failure: ${qg.status}" //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"]) {