Reputation: 61
I’m using Jenkins DSL plugin to generate a Job that needed to be invoked periodically All was going as expected – only the triggering cron that was supposed to be generated by the code below was not displayed in the Job’s GUI, and the job is not triggered peridically When I examined the actual generated job configuration file (config.xml) the cron text was there
Here is the code:
dslFactory.freeStyleJob(jobName+'-PeriodicInvocation') {
triggers {
cron("$cronVal")
}
}
The value of cronVal is fetched from a configuration file.
Using DSL version 1.39, Jenkins version 1.625 on Ubuntu 12.04
Upvotes: 4
Views: 927
Reputation: 61
The value of cron expression that was wrong (had 6 parts instead of 5) example: “H 22 ****”
Once the expression was fixed, the cron expression was visible in the configuration and the job invoked according to the expression. An easy way to check the expression is to try the edit the generated job manually, with the cron expression, and try to save it. If it is wrong Jenkins will not allow it.
Upvotes: 2