Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a parameterized Jenkins job automatically

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!

like image 298
Kevin Avatar asked May 10 '13 06:05

Kevin


People also ask

How do I run a parameterized job in Jenkins?

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.

How do I trigger a build automatically in Jenkins?

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.

How do you create a Jenkins job periodically with parameters?

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).

How is parameter passed to the job to be triggered?

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.


1 Answers

Schedule a separate recurring job and use the Parameterized Trigger Plugin to trigger your parameterized build.

like image 135
Heath Borders Avatar answered Oct 09 '22 08:10

Heath Borders