Hudson Perforce 插件 - 如何自动更新版本而不重复触发构建
我正在尝试使用 Hudson、Maven 和 Maven 进行持续集成。 Perforce(使用 scm 轮询来触发每个构建)
其中一个要求是在每次成功构建后自动更新 POM 快照版本号。
使用 Maven 发布插件,这很简单,但是签入新版本 POM 的行为会触发另一个构建 - 无限地继续下去。
有没有什么方法可以在不触发另一个构建的情况下检查版本更新?当 scm 轮询决定重建时,似乎没有任何方法可以排除特定的用户签入、特定的更改列表或特定的文件。
这似乎是一个基本要求 - 使用 Cruise Control / Ant / Perforce 已经这样做了很多年,
Cheers,
Mark
I'm trying to get continuous integration working using Hudson, Maven & Perforce (with an scm poll used to trigger each build)
One of the requirements is to automatically update POM snapshot version numbers following each successful build.
This is trivial using the Maven release plugin, but the act of checking in the newly versioned POMs triggers another build - which continues ad infinitum.
Is there any way of checking in version updates without triggering another build? There doesn't seem to be any way of excluding specific user checkins, specific changelists, or specific files when the scm poll makes the decision to rebuild.
This seems like a basic requirement - been doing it for years using Cruise Control / Ant / Perforce,
Cheers,
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我一直在考虑搬到 Hudson,但无法从 scm 民意调查中排除特定文件将是一个交易破坏者。您是否也在 Hudson 邮件列表上问过这个问题?
users
hudson
dev
javanet通过阅读文档,我可以看到的唯一解决方法似乎是触发基于 p4 触发器的构建,然后您可以以编程方式执行您想要的任何操作,但这似乎不是一个非常简单的方法。
I have been contemplating a move to Hudson, but the inability to exclude specific files from the scm poll would be a deal breaker. Did you also ask this question on the Hudson mailing list?
users
<at>
hudson<dot>
dev<dot>
java<dot>
netThe only workaround I can see from reading through the docs seems to be triggering builds based on p4 triggers, where you could then programmatically do whatever you want, but that doesn't seem to be a very simple approach.
我不认为有任何方法可以配置 Hudson 在轮询时省略 Perforce 工作区的一部分。通过设置两个不同的工作区,您可能会有更好的运气 - 一个用于使用默认 POM 进行构建测试,另一个用于使用自动更新的发布 POM 进行发布。这两个工作区可能仅在这一个文件上有所不同,并且修改发布 POM 不会触发新的构建。
在 P4Guide< 中查看如何在工作区中进行单个文件映射/a>.
I don't believe there is any way to configure Hudson to omit part of a Perforce workspace when polling. You may have better luck by setting up two different workspaces - one for build test using a default POM and one for your releases with the auto-updated release POM. The two workspaces could differ on just this one file and modifying the release POM would not trigger a new build.
Check out how to do individual file mapping in a workspace in the P4Guide.
提交更改列表后可以更新其描述,因此,如果您构建到某个更改列表编号,则可以更新该更改列表的描述以包含您的内部版本号。这不应该触发新的构建。
Its possible to update the description of a changelist after it has been submitted, so if you build to a certain changelist number you can then update the description of that changelist to include your build number. This shouldnt trigger a new build.
什么是“POM”?
您可以让 Hudson “在 Perforce 中创建或更新标签”(请参阅项目配置底部附近)。您可以将其与 Hudson 提供的 BUILD_NUMBER 环境变量一起使用,为您提供该构建的唯一构建号和标记的 P4 标签。
What is "POM"?
You can have Hudson "Create or Update Label in Perforce" (see near the bottom of your project's configuration.) You could use that along with the BUILD_NUMBER environment variable that Hudson provides, giving you unique build numbers and stamped P4 labels of said build.
我已经通过签入的构建代码完成了所有标记、更改日志更新和打包。这使我们能够:
I have all tagging, ChangeLog updates, and packaging done by our checked in build code. This allows us to:
我在检查编译的 src 时遇到了类似的问题。我能够找到替代方案,但我确实考虑了以下内容。
在 hudson 中指定要轮询的项目的子文件夹。也就是说,实际上并没有 hudson 检查您的项目,只是一个附带文件夹。
添加一个 shell 脚本来检查您的项目是否正确。
不理想,但有效。
I had a similar problem checking in compiled src. I was able to find an alternative but i did consider the following.
In hudson specify a child folder of your project to poll. I.e. don't actually have hudson check out your project, just an incidental folder.
Add a shell script to check out your project proper.
Not ideal, but works.
perforce 插件拥有轮询掩码已经有一段时间了。它位于“查看蒙版”下的“高级”部分。
基本上,您列出了要轮询以检查更改的文件子集。不幸的是,没有简单的方法来排除文件,因此您必须创建一个文件规范列表,指定除要排除的文件之外的所有内容。因此,如果版本包含在 pom.xml 中,我需要指定不包含它的文件和目录。
例如,如果您的目录结构如下所示:
您可以将 指定
为视图掩码,并选中复选框以仅将其用于轮询。此功能有一些限制,例如无法使用“-”来排除文件规范,但目前它仍然是一个可行的解决方案。
The perforce plugin has had polling masks for a while now. It's in the Advanced section under "View Mask".
Basically, you list a subset of files that you want polling to check for changes. Unfortunately there's no easy way to exclude files, so you'll have to create a list of file specs that specify everything BUT the file you want to exclude. So if the version is contained in a pom.xml, I would need to specify the files and directories that don't contain it.
For example, if your directory structure looked like this:
You would specify,
as the view mask, and check the checkbox to use it only for polling. There are a few limitations with this feature, such as not being able to use '-' to exclude file specs, but it's still a workable solution for now.