Hudson无限循环轮询Git仓库中的更改? [英] Hudson infinite loop polling for changes in Git repository?

查看:144
本文介绍了Hudson无限循环轮询Git仓库中的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哈德森的git插件效果很好。但是,构建脚本必须更新存储库文件中的版本号,提交并推送回存储库。



当哈德森旁边轮询检查更改时,它会进入一个无限循环,因为它认为提交作为变更再次构建,它提交了一个变更,所以它再次构建,然后它提交另一个变更等等......你明白了。



我停止了它,在每个版本库中运行了一个git log,并且比较了最新的commit id与使用git ls-tree HEAD完全相同。

另外,Hudson运行这个命令来检查更改:

git fetch + refs / heads / :refs / remotes / origin /
git ls-tree HEAD



由于Hudson本身从其工作空间存储库中提交了提交,并且显然ls-tree结果是匹配的,所以该命令如何确定有什么改变?

看起来它必须存储ls-tree的结果,然后再进行构建并与w进行比较这将不会有最新的提交。啊。我可以尝试关闭提交以测试该理论。



无论如何,而不是解决哈德森的git插件中的任何问题,我该怎么做以确保在我的构建结束时,回购是相同的,哈德森将看到它。



如何解决这个问题?任何想法?



Wayne

解决方案

答案是! ..



Git Hudson插件已经被某人添加了,以增加此功能。不过,我不得不拉下来源并解决一些小问题。



现在它运行得很好。构建提交,并且Git插件无需循环就回退到存储库,并认为它已经改变了。



太棒了!



如果其他人需要在Github.com上查找Hudson-GIT-Plugin的tickzoom分支,但检查是否已经重新集成到主项目中。提交者表示他有兴趣并计划合并叉子。

Wayne


The git plugin for hudson works well. However, the build script must update a version number in the files in the repository, commit, and push back to the repository.

When Hudson polls next to check for changes, it goes into an infinite loop because it sees that commit as a "change" builds again, which commits a change, so it builds again, then it commits another change, etc... You get the idea.

I stopped it, ran a "git log" in each repository and compared the latest commit ids are exactly the same using git ls-tree HEAD

Also, Hudson runs this command to check for changes:

git fetch +refs/heads/:refs/remotes/origin/ git ls-tree HEAD

Since Hudson itself pushed the commit from its workspace repository, and apparently the ls-tree results match, how can this command determine that there as been a change?

It seems that it must be storing the results of ls-tree prior to doing the build and comparing to that which won't have the latest commit. Ah. I can try turning off the commit to test that theory.

Anyway, rather than fix any issue in the git plugin for Hudson, what can I do to make sure at the end of my build that the repos are identical and that Hudson will see it so.

How to fix this? Any ideas?

Wayne

解决方案

And the answer is!...

The Git Hudson plugin was already forked by someone to add this feature it works well. Still, I had to pull down the source and fix a couple of minor issues.

Now it works beautifully. The build commits, and the Git plugin pushes back to the repository without looping, thinking it has again changed.

Wonderful!

If someone else needs this look for the tickzoom fork of the Hudson-GIT-Plugin on Github.com but check to see if has already been integrated back in to the main project. The committer said he was interested and planning on combining the forks.

Wayne

这篇关于Hudson无限循环轮询Git仓库中的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆