Issue
I have a jenkins job. i want to build my job in a specific time with a build parameter.
I want to do this by using the Build periodically
option.
I have input like this:
*/1 * * * * Parameter1
If I do this, jenkins show an error.
Is this possible without using any plugin.
if not, than which plugin will be better
Alternatively is there a way to give parameter's here in the schedule?
My actual requirement is like this:
build in morning using one parameter
build in evening using another parameter.
Solution
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).
Examples:
# Parameter1
H/15 * * * * %Parameter1
# Parameter2
H/30 * * * * %Parameter2
Remember you have to have your parameters already setup because the plugin is visible only for jobs with parameters.
The Node and Label parameter plugin can help since it allows you to select individual nodes assuming your different servers qa1 and qa2 are already configured. Hope that clarifies things for you.
Answered By - Claudio A
Answer Checked By - Pedro (JavaFixing Volunteer)