On Wed, Feb 22, 2017 at 12:13 PM, Tim Downey <timothy.dow...@gmail.com> wrote:
> steps {
>   script {
>     withSonarQubeEnv('VantageSonar') {
>       sh 'mvn clean package sonar:sonar'
>       def qg = waitForQualityGate()
>       if (qg.status != 'OK') {
>         error "Pipeline aborted due to quality gate failure: ${qg.status}"
>       }
>     }
>   }
> }

BTW if the step had an option to return void but mark the build
`UNSTABLE` where appropriate, you could write more simply

steps {
  withSonarQubeEnv(…) {
    sh '…'
    waitForQualityGate markBuildUnstable: true
  }
}

which the round-trip GUI editor could handle because there would be no
need for a `script` block.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr16SRZeMdUp-u9U%3DAXRNCzcUpGBPfNPROQh9KmhcQyYYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to