Jan 7, 2020

Jenkins Build Triggers : How to Schedule Parameterized Jenkins Jobs smartly using Hash Tutorial

We usually schedule automation jobs using Jenkins for executing scheduled automated tests. Many a times, we need to schedule multiple jobs hourly, once, twice or thrice daily.

In case the Build Executor Status is not idle and suppose you have 15 jobs to execute @ 8:00am daily. The resources get choked and the build does not get triggered.

In order to avoid this one should use hash for scheduling the builds. It generates a random hash value using the Job name and decides a minute of every hour using hash value for build to get triggered. In other words, all the 15 jobs would get spread over the entire hour.

In the Image below, "H" before 8*** stands for hash. 

To know more about cron annotations for parameterized scheduling you can take help from: https://crontab.guru/