跟踪从 Hudson 到 Mercurial Repo 的构建
我正在努力建立 Hudson/Mercurial 堆栈进行开发。我的用例之一是“作为一名开发人员,我想将本地沙箱更新为 Hudson 的特定版本号,这样我就可以[修复错误、调试问题、创建代码的分支版本等]。 ”
那么,如果我在 Hudson 上看到 build #49,如何将本地 Mercurial 存储库更新为用于 build #49 的相同源代码?
注意:我已经查看了 Mercurial 标签,但它们似乎不太合适。它们需要提交,因此提交似乎会弄脏历史记录(开发人员的每次提交都会显示标签操作的后续提交)。如果这是最好的,我想我将不得不忍受它,但希望有更好的东西。可能仍会使用标签进行发布。
I'm working on setting up a Hudson/Mercurial stack for development. One of the use cases I have is "As a developer, I want to update my local sandbox to a particular build number from Hudson, so I can [fix a bug, debug issues, create a branched version of code, etc.]."
So, if I see build #49 on Hudson, how do I update my local Mercurial repo to the same source code that was used to build #49?
Note: I have looked at Mercurial tags, however they don't seem quite appropriate. They require a commit, so it seems the commits will dirty up the history (each commit by a developer will show a subsequent commit from the tag operation). If this is the best there is, I guess I will have to live with it, but hoping for something better. Would probably still use tags for releases.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,这是我最终得到的解决方案:
使用描述设置器插件,我将成功和失败的构建描述都设置为“Mercurial ${MERCURIAL_REVISION}”。结果当前的 Mercurial SCM 插件将此环境变量设置为父变更集 ID。
然后,我可以查看 Hudson 上的构建,如果需要,可以获取变更集 id 并在我的本地存储库上执行“hg update”以获取代码修订版。
请注意,在 Mercurial 插件问题跟踪器中,有人讨论将其更改为 HG_REVISION 并添加其他环境变量,因此这可能会在将来的某个时候中断,但目前对我有用。
Ok, here's the solution I ended up with:
Using the Description Setter Plugin, I set both the success and failing build description to "Mercurial ${MERCURIAL_REVISION}". Turns out the current Mercurial SCM plugin sets this environment variable to the parent changeset id.
I can then look at a build on Hudson, and if so desired, grab the changeset id and do a "hg update " on my local repo to get that revision of code.
Note that in the Mercurial plugin issue tracker there is some talk of changing this to HG_REVISION instead and adding other environment variables, so this may break at some point in the future, but works for me for now.
您可以使用 hudson 系统上的关键字扩展将 nodeid 更新到构建的某些方面,可能包括工件名称。如果 Hudson 作业输出工件如下: myproject-2010-02-17-2dbf7575fa46.tar.gz,您当然知道如何“hg update”到该时间点。
关键字扩展和可能的一点 ant-fu 使这很容易做到。
You can use the keywords extension on the hudson system to update the nodeid into some aspect of the build, possibly including the artifact names. If the Hudson job output artifacts are like: myproject-2010-02-17-2dbf7575fa46.tar.gz you certainly know how to 'hg update' to that point in time.
The keywords extension and maybe a little ant-fu make that easy to do.