Is there a buildbot plugin that will poll a git repository for new commits, like the currently included changes.SVNPoller
?
The closest I have found is git_buildbot.py, but it works as a post-commit hook, so will not work with my setup (using Github, and buildbot on a machine that github's post-commit cannot reach) - simply polling the git repository would work perfectly.
I currently have a build run once an hour, but there's not really any point in running the tests unless something has changed..
Update: The kind folks at the Buildbot project have made the GitPoller an official Change Source as of version 0.8.2, and made several improvements to the original.
Our company is in a similar situation where our build machines cannot be reached by GitHub's post-commit hook. I've written a GitPoller
change source that can be used like the SVNPoller
.
It can be found here: http://github.com/wimba/buildbot/blob/master/buildbot/changes/gitpoller.py
and used like this:
from buildbot.changes.gitpoller import GitPoller
c['change_source'] = GitPoller('[email protected]:foobaz/myrepo.git',
branch='great_new_feature')
It will create a local repo to work out of (location configurable), and it's only been tested with git 1.7
so your mileage may vary.
Hopefully it will be pulled into the Buildbot project proper at some point, but it's been working for us so far and hoping it may be of use to others :)
I've not played with buildbot at all but couldn't you do a git fetch
and then look at the output of git log master..origin/master
? If there are no new commits then the output will be empty (there are, of course, a ton of other options you can use on git log
). If there are new commits then just do a git merge
and start your build/test cycle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With