gpt4 book ai didi

jenkins - 使用 job-dsl/pipeline 语法的多个 cron 表达式

转载 作者:行者123 更新时间:2023-12-03 13:45:05 25 4
gpt4 key购买 nike

在 Jenkins 作业配置的 Build Triggers 部分,可以添加多个 cron 表达式,在 Schedule textarea 的每一行上分开,例如:

13 20 * * 0,1,2,3,4,5,6
13 8 * * 0,1,2,3,4,5,6

https://stackoverflow.com/a/44209349/1291886

如何使用 job-dsl/pipeline 语法来做到这一点?

最佳答案

使用 job-dsl 语法:

triggers {
cron('13 20 * * 0,1,2,3,4,5,6 \n 13 8 * * 0,1,2,3,4,5,6')
}

从 job-dsl 文档:

To configure a multi-line entry, use a single trigger string with entries separated by \n.



https://jenkinsci.github.io/job-dsl-plugin/#path/freeStyleJob-triggers-cron

关于jenkins - 使用 job-dsl/pipeline 语法的多个 cron 表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49061633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com