因为我想配置,如果我的 Sonar Qube 质量门出现状态错误,它不应该允许正文中的任何东西,但从 Jenkins Pipeline 中的电子邮件分机发送电子邮件。
stage("Quality Gate"){
steps{
script{
timeout(time: 1, unit: 'HOURS') {
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
post {
always {
emailext attachmentsPattern:'Cucumber HTML Reports/$BUILD_NUMBER/cucumber-html-reports.zip' ,body:"$EMAILTEMPLATE$URLS $SONARQUBE ", mimeType: 'text/html', recipientProviders: [developers()], subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: ' xyz@abc.com'
}
}