In this tutorial, How do I use “Jenkins build periodically with parameters”? Using the “Parameterized Scheduler” Plugin. The default, not yet Parameterized Scheduler plugin in Jenkins. A Jenkins plugin to support parameters in this build scheduler. Jenkins the essential for DevOps Roles.
Make sure you have the necessary plugins installed in Jenkins to support parameterized builds if they are not available by default.
Jenkins build periodically with parameters
Step 1: Setup the Parameterized Scheduler plugin
In “Manage Jenkins” –> In the “Available” tab –> Select “Parameterized Scheduler” –> click “Install without restart”.
To restart Jenkins services
[huupv@huupv devopsroles]$ sudo /etc/init.d/jenkins restart
Step 2: Configure the example
In this example, I use two parameters: NAME and SITE.
In the “Build Triggers” tab, select “Build periodically with parameters”
Jenkins setting automation run job with parameters every fifteen minutes as the picture below
# every fifteen minutes auto run job H/15 * * * * % NAME=Huu; SITE=WWW.DEVOPSROLES.COM
Example “Execute shell” basic.
Conclusion
Through the article, you can use Jenkins build periodically with parameters as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!
Hi Huu,
Thanks your post has helped me a lot, but I am not able to trigger build periodically when passing multiple values in one parameter, please let me know if you know the syntax for the same.
On my project have put one parameter with multiple check box
Hi Ibrahim Patel,
Could you tell me for example? One parameter with multiple checkbox?
you can click sign ? in plugin parameter tell your the syntax.
Thanks,
Hi Huu,
Thanks for you post. Could you please help on below scenairo.
— I have create a job which will have parameter
– I have used choice parameters, in that i have 2 items i.e. (user1,user2)
Now, i want my job to execute first with user1 and user2.
As of now, i am doing this manually by selecting user1 or user2.
Thanks in advance…!
Hi Suresh,
Thank you reading my blog. You can refer example,
################
parameterss = “user1,user2”
targets = parameterss.split(“,”)
for (String artifact : targets){
sh “””
echo $artifact
“””
############
have a good nice!
Hi Huu,
Your post helped me a lot! Could you please help me with the below scenario?
I want to pass a boolean parameter in the parameterized pipeline. I tried using this
40 17 * * * % FULLBUILD=true
this didn’t work and the default value is false.
May be an extra space after “%” sign?
String like “5 4 * * * %PARAM=true” works for me.
Hi Huu,
Im already installed “Parameterized Scheduler” plugin and restart jenkins
But Build periodically with parameters is not show on Build Triggers
On Plugin Manager “Parameterized Scheduler” shown installed as well
Please help me
How can i set equal sign in as part of the value, for example when doing the next string, i’m getting not valid entry
Chunk [USER_PARAMETERS=’AUTO_SPLIT_TESTS=a’] is not a valid entry
Hi Huu ,
I am facing issue
“You can only use one percent sign to separate the cron from the parameters.”
On providing a parameter with percentage(%) sign in corn Jenkins give error message “You can only use one percent sign to separate the cron from the parameters.”
EX: 15 30 * * * % PLIST=https://cloud.abc.com/s3wsapi/config/live%CitrusCollege