Passing parameters to Jenkinsfile job triggered by schedule

Viewed 4832

My jenkinsfile job accepts some parameters used inside the groovy script. Such job is triggered by SCM polling and cron with multiple schedules. I'd like to set different values for job parameters depending on the schedule's times. Is it possible? If so, how could I do that?

1 Answers

I found the plugin Parameterized Scheduler Plugin.

It lets you define many cron-like formatted entries, but with additional parameters for each definition.

Usage examples:

#run against the integration at 15 past the hour
15 * * * * % env=int
#run against the QA at 30 past the hour
30 * * * % env=qa
Related