代码段生成器为我创建了一个properties
块。首次报道
WorkflowScript: 1: The properties section has been renamed as of version 0.8. Use options instead. @ line 1, column 1.
pipeline {
将properties
替换为options
会导致以下错误:
Errors encountered validating Jenkinsfile:
WorkflowScript: 4: options can not be empty @ line 4, column 5.
options([$class: 'ThrottleJobProperty',
以下是完整的jenkinsfile
供参考
pipeline {
agent any
options([[$class: 'ThrottleJobProperty',
categories: ['xcodebuild'],
limitOneJobWithMatchingParams: false,
maxConcurrentPerNode: 0,
maxConcurrentTotal: 0,
paramsToUseForLimit: '',
throttleEnabled: true,
throttleOption: 'category']])
stages {
stage("Empty" {
steps {
echo "Do nothing"
}
}
}
}
答案 0 :(得分:5)
在选项
中不再可以使用自定义$class
请注意,
[$class: 'Foo', arg1: 'something', ...]
语法不能使用,只能使用booleanParam(...)
等。
JobProperty
,例如buildDiscarder
或disableConcurrentBuilds
,声明式特定选项,例如skipDefaultCheckout
和“包装器” “它应该包装整个构建,例如timeout
。pipeline
关闭。@Symbol
名称。
[$class: 'Foo', arg1: 'something', ...]
语法不能使用,只能使用booleanParam(...)
等。parameters
和pipelineTriggers
@Symbol
。示例:
options {
buildDiscarder(logRotator(numToKeepStr:'1'))
disableConcurrentBuilds()
}