In a Jenkins job config's Build Triggers section, it is possible to add multiple cron expressions separated on each line in the Schedule textarea e.g:
13 20 * * 0,1,2,3,4,5,6
13 8 * * 0,1,2,3,4,5,6
https://stackoverflow.com/a/44209349/1291886
How would one do this using the job-dsl/pipeline syntax?
Using the job-dsl syntax:
triggers {
cron('13 20 * * 0,1,2,3,4,5,6 \n 13 8 * * 0,1,2,3,4,5,6')
}
From the job-dsl documentation:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With