Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable SCM polling with the Jenkins Pipeline plugin

Tags:

This is a question related to How to make SCM polling work with the Jenkins Workflow plugin. That thread answers how to use SCM polling in a pipeline script once SCM polling is enabled but does not cover how to enable SCM polling.

For example, if you wanted to use the mulit-branch pipeline plugin to create jobs automatically using a Jenkinsfile there is not a way I know of to have the "Poll SCM" option enabled in the job. This makes it difficult to provision on-demand environments such as creating a docker container that has the jobs setup from the beginning. Because you would have to sign-in to Jenkins and go to the configuration and select the "Poll SCM" option once the container was started. Cloudbees offers a template plugin to help solve this problem.

However this is not available to Jenkins using the free version. Is there any workaround or solution for users on the free version of Jenkins?

like image 935
mdo123 Avatar asked Mar 04 '16 20:03

mdo123


People also ask

What is poll SCM in Jenkins pipeline?

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.

Which plugin allows use of Git as a SCM in Jenkins?

The git plugin provides fundamental git operations for Jenkins projects. It can poll, fetch, checkout, branch, list, merge, tag, and push repositories.

What is poll SCM schedule 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.


1 Answers

if you wanted to use the multi-branch pipeline plugin to create jobs automatically using a Jenkinsfile there is not a way I know of to have the "Poll SCM" option enabled in the job

Nor is any needed. Multibranch projects have a configurable polling interval for the branch indexing as a whole, which also serves as a per-branch build trigger, and will also receive webhooks automatically.

like image 95
Jesse Glick Avatar answered Sep 16 '22 22:09

Jesse Glick