Running a parameterized job at a particular time in jenkins

Kishore Tamire picture Kishore Tamire · May 29, 2013 · Viewed 32.8k times · Source

I have a parameterized job which I want to schedule it to run at a particular time. Is there anyway I can choose my parameters and schedule it to run.

Thanks in advance

Answer

Gonen picture Gonen · May 30, 2013

At least two ways to handle this,
but you have to know the desired values in advance:

  • Set the job's default values to what you need,
    then schedule it to run whenever you like.

  • Instead of scheduling the parameterized job,
    create another job that will trigger the
    parameterized job while passing the relevant
    values to the parameters
    (This also allows you to initiate the target-job
    with different sets of values).

EDIT:

This third method will allow you to update the values of the parameters as needed:

  • Set the job to read values of parameters from a configuration-file
    (via the EnvInject Plugin), then update the content of that configuration-file
    before running the job.

Note it will be bad-practice to modify this file before each run,
as there are better ways to automatically initiate Jenkins-jobs with parameters.