How to make a Jenkins job to poll SCM periodicallyTweet
Posted on Sunday Feb 23, 2014 at 11:11AM in Jenkins
- Jenkins 1.551
- git version 22.214.171.124 (Apple Git-47)
- OS X 10.9.1
Why need it?
- As I wrote in How to make git commit to trigger run a Jenkins job, Git plugin of Eclipse doesn't fire hooks.
- Unfortunately, currently EGit not supported it, and maybe will not.
- So we need an alternative way, such as make Jenkins to poll SCM periodically.
- It seems to I can configure it easily so I just try it here.
How to configure
- Go to configure page of a project.
- Go to “Build Triggers” section.
- Check “Poll SCM”
- Enter the schedule that you want in cron-style.
- The help that placed side of input area might be useful
- Example for poll at every 15minutes is here:
See the log
- When any change is detected at polling, we can see that message in log of Jenkins.
- In this setup, the log file is located at /var/log/jenkins/jenkins.log
Feb 23, 2014 11:24:45 AM hudson.triggers.SCMTrigger$Runner run 情報: SCM changes detected in BuildAndTestHead. Triggering #22 Feb 23, 2014 11:24:57 AM hudson.model.Run execute 情報: BuildAndTestHead #22 main build action completed: SUCCESS
- I'm not sure that CPU usage or any other resource consumption of git polling.