使用适用于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}" } }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)