Jenkins Cron计划无效触发类型“参数化”
我试图根据参数每天晚上仅在管道中运行C级C。但是管道使我抛出了无效的触发类型“参数化”错误。以下是我的管道脚本。请帮助可能的问题。另外,我的管道不是通过Cron作业触发的,我需要手动触发。
pipeline {
agent any
}
parameters {
choice(
name: 'ENV',
choices: [ 'uat', 'perf' ],
)
booleanParam(
name: 'RUN',
defaultValue: true
)
}
triggers {
parameterizedCron('''
17 14 * * * %RUN=true;ENV=uat
''')
}
stages {
stage ('A') {
}
stage ('B') {
}
stage('C') {
when {
expression { env.RUN || env.ENV == 'uat' }
}
## RUN THIS STAGE
}
}
I'm trying to run only Stage C in pipeline every night based on the parameters. But pipeline is throwing me Invalid trigger type "parameterizedCron" error. Below is my pipeline script. Please help what could be the issue. Also my pipeline is not triggering via cron job i need to trigger manually.
pipeline {
agent any
}
parameters {
choice(
name: 'ENV',
choices: [ 'uat', 'perf' ],
)
booleanParam(
name: 'RUN',
defaultValue: true
)
}
triggers {
parameterizedCron('''
17 14 * * * %RUN=true;ENV=uat
''')
}
stages {
stage ('A') {
}
stage ('B') {
}
stage('C') {
when {
expression { env.RUN || env.ENV == 'uat' }
}
## RUN THIS STAGE
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否已安装并启用了插件?
如果您刚安装了插件,请尝试重新启动Jenkins。
Have you installed and enabled the plugin?
If you freshly installed the plugin try restarting Jenkins.