Jenkins Git Plugin, SCM Polling, and Duplicate Builds

I have a Jenkins instance running inside a firewall performing builds against a GitHub hosted repository. Because of the firewall and security concerns, GitHub webhooks are not an option for triggering builds, but I still have a requirement to build every commit. Enter the SCM polling feature of the Jenkins Git plugin. With this feature enabled, a Jenkins job will poll the repository based on a schedule you define (using a cron-style schedule) and trigger a build for each change it sees based on the refspec you defined for your repository. This is great, except that in my case, Jenkins was kicking off a build of the repository head on every poll, despite there being no new commits. After a bunch of head scratching and exercising my google-foo, I finally stumbled upon a thread on the Jenkins mailing list that described an issue very similar to mine. One of the recommendations was to set the "Force polling using workspace" under "Additional Behaviours" in the Git plugin config. After setting this option, the duplicate builds stopped triggering.

Comments

Popular posts from this blog

SSH Private Keys - RSA vs. OpenSSH

Google Wifi and Verizon FiOS