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
Basically, with the 'Build periodically' option you can't schedule a Jenkins job with parameters. However, to schedule a job at different times that needs to use different environments, you have to use the parameterized-scheduler plugin or search for it in (Manage Jenkins -> Manage Plugins -> Parameterized Scheduler).
Add a Schedule to a Jenkins JobHead back to the job configuration and click the Build Triggers tab. Now, check the Build periodically box in the Build Triggers section. This will open the scheduling text area. Next, let's set the job to run every five minutes.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With