buildbot 是否会轮询 git 存储库以获取新提交?
是否有一个 buildbot 插件可以轮询 git 存储库以获取新提交,例如当前包含的 changes.SVNPoller
?
我发现的最接近的是 git_buildbot.py,但它作为提交后挂钩,因此不适用于我的设置(在 github 提交后无法到达的机器上使用 Github 和 buildbot) - 只需轮询 git 存储库就可以完美工作。
我目前每小时运行一次构建,但是除非发生了变化,否则运行测试实际上没有任何意义。
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..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我根本没有玩过 buildbot,但是你不能执行 git fetch ,然后查看 git log master..origin/master 的输出吗? 如果没有新的提交,那么输出将为空(当然,您可以在 git log 上使用大量其他选项)。 如果有新的提交,则只需执行 git merge 并开始构建/测试周期。
I've not played with buildbot at all but couldn't you do a
git fetch
and then look at the output ofgit 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 ongit log
). If there are new commits then just do agit merge
and start your build/test cycle.我喜欢 gitpoller.py 方法,但目前我发现它有点受限(例如不发送修订版本、项目参数),因此找到了不同的解决方案:
我有从远程克隆的自己的存储库和帖子调用的 git_buildbot.py -merge 挂钩(如 git_buildbot.py 中所述)。 我有一个小循环正在睡觉,并且 git 拉入该存储库,这将触发合并后挂钩。
I like the gitpoller.py approach but at the moment I found it a bit limited (e.g. does not send revisions, project arguments) so found a different solution:
I have my own repository cloned from the remote and git_buildbot.py called by the post-merge hook (as described in git_buildbot.py). I have a small loop sleeping and git pulling in that repo which will trigger the post-merge hook.
更新: Buildbot 项目的好心人已将 GitPoller 作为 0.8.2 版的官方更改源,并对原始版本进行了多项改进。
我们公司也面临着类似的情况,GitHub 的 post-commit hook 无法访问我们的构建机器。 我编写了一个
GitPoller
更改源,可以像SVNPoller
一样使用。可以在这里找到: http://github.com/wimba /buildbot/blob/master/buildbot/changes/gitpoller.py
并像这样使用:
它将创建一个本地存储库来工作(位置可配置),并且仅使用
git 1.7< 进行了测试/code> 因此您的里程可能会有所不同。
希望它能在某个时候被适当地纳入 Buildbot 项目,但到目前为止它一直在为我们工作,并希望它对其他人有用:)
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 theSVNPoller
.It can be found here: http://github.com/wimba/buildbot/blob/master/buildbot/changes/gitpoller.py
and used like this:
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 :)