bonafide
bonafide

Reputation: 368

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.?

Upvotes: 2

Views: 1402

Answers (1)

9000
9000

Reputation: 40904

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.

Upvotes: 0

Related Questions