我想寫有條件構建步驟jobdsl塊,如果條件爲真發送電子郵件, 它失敗對我來說,請協助改善下面的代碼(堆棧跟蹤下文)詹金斯JObDSL條件生成步驟發送郵件的問題
job {
name 'ci'
description 'Build and test the app.'
scm {
git {
remote {
github 'sheehan/job-dsl-playground'
}
}
}
steps {
gradle 'test'
conditionalSteps {
condition {
stringsMatch('${ENV,var="CHILD_BUILD"}', "true", false)
}
extendedEmail("[email protected]", "for Componets",
"Test Jira")
}
}
publishers {
archiveJunit 'build/test-results/**/*.xml'
}
}
堆棧跟蹤:
groovy.lang.MissingMethodException:方法的無簽名: javaposse.jobdsl.dsl.helpers.step.ConditionalStepsContext.extendedEmail() 適用於參數類型:(java中。 lang.String,java.l ang.String, java.lang.String中)的值:[[email protected],對成品的配件,測試 吉拉]在 javaposse.jobdsl.dsl.helpers.AbstractExtensibleContext.methodMissing(AbstractExtensibleContext.groovy:19) 在 javaposse.jobdsl.dsl.AbstractContext.invokeMethod(AbstractContext.groovy) 在 script14321438737322039521488 $ _run_closure1_closure3_closure7.doCall(script14321438737322039521488.groovy:17) 在 script14321438737322039521488 $ _run_closure1_closure3_closure7.doCall(script14321438737322039521488.groovy) 在 javaposse.jobdsl.dsl .ContextHelper.executeInContext(ContextHelper.groovy:14) at javaposse.jobdsl.dsl.ContextH elper $ executeInContext.call(未知 來源)在 javaposse.jobdsl.dsl.ContextHelper $ executeInContext.call(未知 來源)在 javaposse.jobdsl.dsl.helpers.step.StepContext.conditionalSteps(StepContext.groovy:554) 在 script14321438737322039521488 $ _run_closure1_closure3.doCall(script14321438737322039521488.groovy:13)在 script14321438737322039521488 $ _run_closure1_closure3.doCall(script14321438737322039521488.groovy) 在 javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:14) 在javaposse。 jobdsl.dsl.ContextHelper $ executeInContext.call(Unknown Source)at javaposse.jobdsl.dsl.ContextHelper $ exec uteInContext.call(未知 來源)在javaposse.jobdsl.dsl.Job.steps(Job.groovy:510)在 script14321438737322039521488 $ _run_closure1.doCall(script14321438737322039521488.groovy:11) 在javaposse.jobdsl.dsl.JobParent.job (JobParent.groovy:110)在 javaposse.jobdsl.dsl.JobParent.job(JobParent.groovy)在 javaposse.jobdsl.dsl.DslFactory $ job.callCurrent(來源不明)在 script14321438737322039521488.run(script14321438737322039521488.groovy: 1) 處 javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:72) 在 javaposse.jobdsl.dsl.DslScriptLoader $ runDslEngineForParent.call(未知 來源) com.sheehan.jobdsl.DslScriptExecutor.execute(DslScriptExecutor.groovy:31) at com.sheehan.jobdsl.ScriptExecutor $ execute.call(Unknown Source)at Ratpack $ _run_closure1_closure3_closure7.doCall(Ratpack.groovy:39)at ratpack .groovy.internal.ClosureInvoker.invoke(ClosureInvoker.java:65) at ratpack.groovy.handling.internal.ClosureBackedHandler.handle(ClosureBackedHandler。的java:42)
你有沒有條件步驟插件安裝? https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin – KeepCalmAndCarryOn
是的,也是我認爲這是更多的配置和獨立的真正的插件正在安裝或現在 – Stock