如何对詹金斯管道内的SonarQube质量门做出反应

如何对詹金斯管道内的SonarQube质量门做出反应,第1张

如何对詹金斯管道内的SonarQube质量门做出反应

使用适用于Jenkins
2.8.1
的SonarQube
Scanner,可以立即使用该解决方案

stage('SonarQube analysis') {    withSonarQubeEnv('My SonarQube Server') {        sh 'mvn clean package sonar:sonar'    } // SonarQube taskId is automatically attached to the pipeline context  }}stage("Quality Gate"){    timeout(time: 1, unit: 'HOURS') { // Just in case something goes wrong, pipeline will be killed after a timeout    def qg = waitForQualityGate() // Reuse taskId previously collected by withSonarQubeEnv    if (qg.status != 'OK') {        error "Pipeline aborted due to quality gate failure: ${qg.status}"    }  }}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5652102.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存