简体   繁体   中英

How to schedule Jenkins job to build Monday-Friday

I have a jenkins job used to automate VMs start/stop in Azure. Currently, I have this schedule to run daily (stops VMs at 8 and starts them back up at 5AM). I want to be able to run this job Monday-Friday(Start/Stop) then Saturday-Sunday(Stop only) until the work week starts again.

I am using one job & set my schedule using the Build Periodically with parameters plugin. set as follows:

H 5 * * 1-5 % OPTIONS=start
H 20 * * 1-5 % OPTIONS=stop

What would you recommend.?

I'd keep your original "payload" job without making it periodic.

I'd create two other "trigger" jobs, whose entire purpose would be to trigger your "payload" job, passing right parameters to it. Both jobs would use the 'Trigger other jobs' action from the Parametrized Trigger plugin.

Each job would run periodically with its own schedule, passing either "start" or "stop" parameter to your "payload" job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM