Ant*_*sov 7 groovy jenkins jenkins-pipeline
摘要生成器properties为我创建了一个区块。首次运行报告
WorkflowScript: 1: The properties section has been renamed as of version 0.8. Use options instead. @ line 1, column 1.
pipeline {
Run Code Online (Sandbox Code Playgroud)
替换properties为options结果并显示以下错误:
Errors encountered validating Jenkinsfile:
WorkflowScript: 4: options can not be empty @ line 4, column 5.
options([$class: 'ThrottleJobProperty',
Run Code Online (Sandbox Code Playgroud)
这是完整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"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
It's no longer possible to use custom $class in the options
Note that
[$class: 'Foo', arg1: 'something', ...]syntax can not be used, onlybooleanParam(...)and the like.
JobPropertys, such as buildDiscarder or disableConcurrentBuilds, Declarative-specifc options, such as skipDefaultCheckout, and "wrappers" that should wrap the entire build, such as timeout.pipeline closure only.@Symbol构造函数的名称。
[$class: 'Foo', arg1: 'something', ...]不能仅使用语法booleanParam(...)等。parameters和pipelineTriggers @Symbol不能在此处直接使用。例:
options {
buildDiscarder(logRotator(numToKeepStr:'1'))
disableConcurrentBuilds()
}
Run Code Online (Sandbox Code Playgroud)
小智 5
它对我有用。
properties([parameters([choice(choices: 'test\ndeploy', name: 'baranch')])])
pipeline{
agent any
stages{
stage('param check'){
when {
expression{
params.baranch == 'test'
}
}
steps{
echo "testing"
}
}
}
Run Code Online (Sandbox Code Playgroud)
}
| 归档时间: |
|
| 查看次数: |
11506 次 |
| 最近记录: |