I have a Jenkins job that takes a source branch name as a parameter. Now I want to schedule the job to run at midnight everyday. As you always need to input the parameter even though the default value has been set. So my question is, is there a way to automate the execution of a parameterized job?
Thanks!
Any Jenkins job or pipeline can be parameterized. All we need to do is check the box on the General settings tab, “This project is parameterized”: Then we click the Add Parameter button.
Follow the steps as mentioned below to trigger a Jenkins job automatically based on GitHub's webhook configurations: Step 1: Go to the Configuration page of the respective job and under the build trigger section, check the "GitHub hook trigger for GITScm polling" checkbox and click on the Save button.
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).
You can use Parameterized Trigger Plugin which will let you pass parameters from one task to another. You need also add this parameter you passed from upstream in downstream.
Schedule a separate recurring job and use the Parameterized Trigger Plugin to trigger your parameterized build.
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