I've set up a job in Jenkins that polls my Mercurial repository, using the Mercurial plugin. This works well once I开发者_如何学运维 push to the repository. I can trigger a build of the job manually, but I can't trigger the hg pull/update that happens as part of the poll, which means I have to wait up to 60 seconds for the build to start with my new changes. Sometimes I'm pushing changes that I know will affect and possibly break the system build and want faster feedback. What's the best way to pull/update before a manual build?
Is your quiet period set? You can change that to 0 to trigger builde immediately (http://jenkins-ci.org/content/quiet-period-feature)
Also, you could have two jobs, one that you have right now, and a second one that only polls for changes. The "poller" could trigger your current job when it sees changes ("Build after project").
I would suggest if your having issues with update/pull with hg. what you can do is is the use the execute shell to update your build since your shooting off your build manaually. Then you can have the job build periodically; so it will cause your pull to happen whatever you set you build period to be. You wont have to worry about polling your SCM.
It seems that I am wrong. I must have missed something in the log when I was initially testing this, or maybe I hit the manual build link before the push went through to the server. Jenkins seems to perform a hg incoming
then hg unbundle
then hg update
at the start of each build, even when the build is triggered manually, which is exactly what I wanted.
精彩评论