Configure Jenkins to Poll less than every minute
Asked Answered
R

3

13

Configuring the Jenkins polling interval to: * * * * * will poll the SCM for every minute. Is there a way to configure it to poll less than a minute? for example every 30 seconds?

Rumania answered 9/5, 2013 at 13:34 Comment(5)
Just curious...why do you need this?Hassi
Sometimes there are two commits submitted in the same minute. Jenkins won't build them both. It will build only the latest commit. I want to build them both.Rumania
But if the two changes were submitted within 30 seconds of each other, your problem is still not resolved. Even if you could poll every second, you'd still potentially have two changes checked in within a second of each other. It seems that @Stuart_Whelan's answer is correct...you need to approach this differently and get the SCM to trigger your builds instead of polling for changes.Hassi
I have added some more information to my answer now that I know more about the issue.Brose
You can configure like this under configuration for pipeline job - only for 1 min ![Pipeline configuration](i.sstatic.net/ABdZX.png)Scaly
M
4

Jenkins uses Cron syntax for polling. Not sure you can get to 30 seconds since Cron has a 60 sec granularity.

Check out this: How to get a unix script to run every 15 seconds?

Meave answered 9/5, 2013 at 15:51 Comment(0)
B
4

Get your SCM to trigger the build instead of polling for it.

What SCM are you using?

Edit:

You can tell Jenkins to wait 'x' seconds after the check in change before starting the build. I have the same issue, dev's doing multiple check ins.

There are two options to configure this, a system wide option or a per-job option.

The system wide option is under Manage -> Configure System -> Quiet Period. It is in seconds.

The per job option is under Advanced Project Options, and is also called Quiet Period.

If you set quiet period to 90, Jenkins will wait until 90 seconds after the last detected check in before starting the build.

Brose answered 9/5, 2013 at 22:26 Comment(4)
I'm using Perforce, but I'm not the administrator of the Perforce web server. Is it possible to trigger the build using the Jenkins Perforce plugin?Rumania
Reading the Wiki for the preforce plugin, it does not look as if it supports event base build triggers. The quiet period may be your best option.Brose
I don't mind people providing other options, but keep in mind that some people can't have the SCM trigger the build for environmental reasons... just sayingMarybethmaryellen
Polling is generally poor design. For anyone using Git and GitHub, you can switch to build on every commit through webhooks. Jenkins has a GitHub Plugin and Pull Request builder plugin.Atherosclerosis
R
1

I've found the solution, and explained it here:

Jenkins Perforce Plugin - multiple changelists in a single poll

Thanks for the ideas!

Rumania answered 16/6, 2013 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.