Dav*_*est 5 jenkins jenkins-plugins jenkins-pipeline
在声明性管道中使用日期参数插件的语法是什么。
到目前为止我已经尝试过这个:
pipeline {
agent {
node {
label 'grange-jenkins-slave'
}
}
options { disableConcurrentBuilds() }
parameters {
date(name: 'EffectiveDate',
dateFormat: 'MMddyyy',
defaultValue: 'LocalDate.now();',
description: 'Effective Date',
trim: true)
file(name:'algo.xlsx', description:'Your algorithm file')
choice(name: 'currency',
choices: ['USD'],
description: 'Select a currency')
}
stages {
stage('genRates') {
steps {
script {
echo "test"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
}
我得到的错误是WorkflowScript: 11: Invalid parameter type "date". Valid parameter types: [booleanParam, choice, credentials, file, text, password, run, string] @ line 11, column 3.
您可以将参数定义为类 DateParameterDefinition。
例子:
properties([parameters([
string(name: 'somestring', defaultValue: 'somevalue'),
[$class: 'DateParameterDefinition',
name: 'somedate',
dateFormat: 'yyyyMMdd',
defaultValue: 'LocalDate.now()']
])])
pipeline {
...
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7643 次 |
最近记录: |