我正在尝试向现有的Jenkins作业中添加一个布尔参数,但是当我添加它时,我的seedjob会停止工作。
我的工作定义:
job('ci') {
description 'Build and test the app.'
scm {
github 'sheehan/job-dsl-playground'
}
steps {
gradle 'test'
}
publishers {
archiveJunit 'build/test-results/**/*.xml'
}
configure { project ->
project / 'properties' / 'hudson.model.ParametersDefinitionProperty' {
'parameterDefinitions' {
'hudson.model.BooleanParameterDefinition' {
name('my-param')
description("my-param-description")
defaultValue(true)
}
}
}
}
}
您可以通过在此页面上粘贴作业定义代码来重现错误:https://job-dsl.herokuapp.com/
该错误仍然存在,但是我设法通过删除BooleanParameterDefinition
的描述来解决它。所以我的最终代码如下:
job('ci') {
description 'Build and test the app.'
scm {
github 'sheehan/job-dsl-playground'
}
steps {
gradle 'test'
}
publishers {
archiveJunit 'build/test-results/**/*.xml'
}
configure { project ->
project / 'properties' / 'hudson.model.ParametersDefinitionProperty' {
'parameterDefinitions' {
'hudson.model.BooleanParameterDefinition' {
name('my-param')
defaultValue(true)
}
}
}
}
}