How to enable SCM polling with the Jenkins Pipeline plugin

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.

  • How to use docker for many connected projects
  • How to setup a docker swarm cluster with AWS ubuntu machine [closed]
  • --add-host parameter in Marathon docker application
  • How to write data to host file system from Docker container
  • Make a CMD effect on docker run but not in docker start
  • Limit number of process in docker
  • 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?

  • How to use docker-java API to connect docker?
  • Remote Docker and volume binding
  • Gitlab migrate from 6.x to 8 in docker
  • Docker map drive from Docker container to Linux to Windows host
  • Will docker cost system resources to exchange data with system?
  • Deploying an existing docker image with Deis
  • 3 Solutions collect form web for “How to enable SCM polling with the Jenkins Pipeline plugin”

    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.

    I am thinking about the same problem.

    If you are using a online Git service like Github or Bitbucket, I think you could use their Webhooks features to solve it. I have not been able to test the solution yet, but it should work.

    In your Multibranch Pipeline configuration, enable the Trigger builds remotely option.

    Then you need to enable your Github/Bitbucket Webhook on your repository, using the path (as described in the Jenkins configuration descrition): JENKINS_URL/job/test/build?token=TOKEN_NAME

    To answer the question how to enable SCM polling, you need to do the following.

    Using the Pipeline Syntax generator and “properties: Set job properties” you can generate the following which will enable SCM polling.


    However as Jesse Glick points out for Multibranch pipelines you don’t need to enable SCM polling.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.