简体   繁体   English

Jenkins管道的质量门状态不起作用

[英]Quality Gate status with Jenkins pipeline not working

While checking quality gate status in pipeine, getting following error. 在检查流水线中的质量门状态时,出现以下错误。

Pipeline Code is below 管道代码如下

    stage('SonarQube') {
      // Run the maven build
            dir("xyz_7.6_Trunk/xyz-services"){


                sh ' mvn -f pom.xml clean install -Dapp.server=jboss org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.host.url=http://10.11.135.66:9000 -Dsonar.scm.disabled=True -U' 

            }
            }

stage('Quality Gate') {
timeout(time: 1, unit: ‘HOURS’) {
def qg = waitForQualityGate()
if (qg.status != ‘OK’) {
error “Pipeline aborted due to quality gate failure: ${qg.status}”
}
}
}

Error log is below. 错误日志如下。

java.lang.NoSuchMethodError: No such DSL method 'Time' 'HOURS' found among steps [acceptGitLabMR, addBadge, addErrorBadge, addGitLabMRComment, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, ansiblePlaybook, ansibleTower, ansibleVault, archive, artifactPromotion, bat, build, catchError, checkout, createSummary, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerNode, ec2, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, getContext, git, gitChangelog, gitlabBuilds, gitlabCommitStatus, input, isUnix, junit, library, libraryResource, load, mail, milestone, nexusArtifactUploader, nexusPolicyEvaluation, nexusPublisher, node, parallel, powershell, properties, pwd, readFile, readTrusted, removeBadges,  

As I see, you use scripted pipeline, so the syntax should be fine. 如我所见,您使用脚本化管道,因此语法应该不错。

timeout functionality is implemented in Pipeline: Basic Steps plugin (part of Pipeline plugin). timeout功能是在“ Pipeline: Basic Steps插件( Pipeline插件的一部分)中实现的。 That's why I think that you need to reinstall those plugins and the issue should be fixed. 因此,我认为您需要重新安装这些插件,并且该问题应已解决。 Anyway, please check again the syntax of the timeout step. 无论如何,请再次检查timeout步骤的语法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM