Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Jenkins to Poll less than every minute

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?

like image 506
Avi Rosenfeld Avatar asked May 09 '13 13:05

Avi Rosenfeld


People also ask

What is the difference between build periodically and poll SCM in Jenkins?

Poll SCM periodically polls the SCM to check whether changes were made (i.e. new commits) and builds the project if new commits where pushed since the last build, whereas build periodically builds the project periodically even if nothing has changed.

Can Jenkins build be triggered automatically?

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 does Jenkins polling work?

Polling. If you configure the Poll SCM trigger in the Pipeline's UI configuration screen, then by default Jenkins will also poll for changes according to the selected Schedule, and schedule new builds automatically if changes are detected.


2 Answers

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?

like image 50
Chewpers Avatar answered Sep 28 '22 04:09

Chewpers


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.

like image 25
Stuart Whelan Avatar answered Sep 28 '22 05:09

Stuart Whelan