-
-
Save elonmusk408/c73d2bc2e67bb9e6d756e3343b71e675 to your computer and use it in GitHub Desktop.
Revisions
-
rmpestano revised this gist
Apr 12, 2018 . 1 changed file with 9 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,13 +20,14 @@ * */ def call() { timeout(time: 3, unit: 'MINUTES') { echo "Initializing quality gates..." sh 'sleep 10' //small delay because project quality can still being published on previous stage (specially on bigger projects). def result = waitForQualityGate() //this is enabled by quality gates plugin: https://wiki.jenkins.io/display/JENKINS/Quality+Gates+Plugin if (result.status != 'OK') { error "Pipeline aborted due to quality gate failure: ${result.status}" } else { echo "Quality gate passed with result: ${result.status}" } } } -
rmpestano revised this gist
Apr 2, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/usr/bin/env groovy /** * Fails the pipeline if project quality doesn't meet the configured quality profile (see https://docs.sonarqube.org/display/SONAR/Quality+Gates AND https://docs.sonarqube.org/display/SONAR/Quality+Profiles). * This DSL function must be invoked after the quality analisys has been published. Example: * * stage('sonar') { -
rmpestano revised this gist
Apr 2, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ /** * Fails the pipeline if project quality doesn't meet the configured quality profile (see https://docs.sonarqube.org/display/SONAR/Quality+Profiles). * This DSL function must be invoked after the quality analisys has been published. Example: * * stage('sonar') { * steps { -
rmpestano revised this gist
Apr 2, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def call() { echo "Initializing quality gates..." sh 'sleep 10' //small delay because project quality can still being published on previous stage (specially on bigger projects). def result = waitForQualityGate() //this is enabled by quality gates plugin: https://wiki.jenkins.io/display/JENKINS/Quality+Gates+Plugin if (result.status != 'OK') { error "Pipeline aborted due to quality gate failure: ${result.status}" } else { -
rmpestano revised this gist
Apr 2, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/usr/bin/env groovy /** * Fails the pipeline if project quality doesn't meet the configured quality profile (see https://docs.sonarqube.org/display/SONAR/Quality+Profiles). * This DSL function must be invoked after the quality analisys has been published. * * stage('sonar') { @@ -14,7 +14,7 @@ * * stage('quality-gates') { * steps { * qualityGates() //this stage will fail if project quality doesn't meet its quality profile * } * } * -
rmpestano revised this gist
Apr 2, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,8 +20,8 @@ * */ def call() { echo "Initializing quality gates..." sh 'sleep 10' //small delay because project quality can still being published on previous stage (specially on bigger projects). def result = waitForQualityGate() if (result.status != 'OK') { error "Pipeline aborted due to quality gate failure: ${result.status}" -
rmpestano created this gist
Apr 2, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #!/usr/bin/env groovy /** * Fails the pipeline if project quality doesn't meet the configured quality profile. * This DSL function must be invoked after the quality analisys has been published. * * stage('sonar') { * steps { * withSonarQubeEnv('sonar') { //there must be a tool named 'sonar' configured on Jenkins (/jenkins/configureTools) * sh 'mvn sonar:sonar' //publish project quality on sonar * } * } * } * * stage('quality-gates') { * steps { * qualityGates() //this stage will fail if project quality doesn't meet its quality profile (see https://docs.sonarqube.org/display/SONAR/Quality+Profiles) * } * } * */ def call() { echo "Iniciando quality gates..." sh 'sleep 10' def result = waitForQualityGate() if (result.status != 'OK') { error "Pipeline aborted due to quality gate failure: ${result.status}" } else { echo "Quality gate passed with result: ${result.status}" } }