哈德逊 CI 和项目依赖
Hudson CI 工具能否解决除琐碎问题之外的项目依赖关系? 例如,如何设置有两个独立模块(A,B)且模块C依赖于A和B的场景?
我认为没有办法:
- “构建其他项目”不能保证 A、B 在 C 之前构建
- “在其他项目构建之后构建”只能保证“C 在 A 或 B 之后触发” (需要 A 和 B)
- 如果有 ~ 3 个模块,Join 插件可以解决这个问题。如果有模块A1,.....,A100和C1,.....,C100,那么应该编写100个额外的Join触发器并发出100个B的额外重建(换句话说,每个B的反向依赖需要重建B)。因此,如果 Join 触发器不能被简单的 XML 破解,并且不能跳过未更改的 B 的无意义重建(这可能吗?),这是不切实际的。
那么是否有某种方法或标准解决方法可以实现这一目标?
Can Hudson CI tool solve project dependencies others than trivial ones?
For example, how can I set up scenario in which there are two independent modules (A, B) and module C dependent on A and B?
There's no way in my opinion:
- "Build others project" doesn't guarantee that A, B are built before C
- "Build after other projects are built" guarantee only "C is triggered after A or B" (A and B needed)
- Join plugin can solve this if one has ~ 3 modules. If there are modules A1, ....., A100 and C1, ....., C100 then it is supposed to write 100 additional Join triggers and issue 100 additional rebuilds of B (in other words, every B's reverse dependency needs rebuild of B). So in case that Join triggers cannot be trivially XML hacked and nonsense rebuilds of unchanged B cannot be skipped (is this possible?) it is unpractical.
So is there some way or some standard workaround to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我可能会遗漏一些东西,但你的第二个选项应该可以工作:
在构建其他项目后构建”保证仅“在A或B之后触发C”(需要A和B)
这意味着每次发生更改时都会构建C A 或 B。如果 A 和 B 确实如您所说彼此独立,则满足所有依赖性。
I might be missing something, but your second option ought to work:
Build after other projects are built" guarantee only "C is triggered after A or B" (A and B needed)
This means that C will be built every time there are changes to either A or B. If A and B are truly independent of each other as you say, that satisfies all the dependencies.
也许您可以尝试使用 Ivy 插件,该插件使用 Apache Ivy 来管理依赖项。
Perhaps you can try using the Ivy plugin, which uses Apache Ivy to manage dependencies.
我认为如果您的构建没有立即发生,那么这并不重要。因此您可以更改检查 SCM 的安排。假设 A 将在每天午夜被触发检查 SCM。然后配置 B 每天凌晨 2 点检查(取决于 A 的构建时间),C 则在 2 小时后检查。由于您将拥有 A 和 B 的工件,因此 C 将构建得很好。对于新创建的作业,您也会有工件,因为您需要测试您的配置,您只需手动触发第一个构建。
如果这不是一个选择,您始终可以构建所有 3 个。这意味着您创建作业 D,其中包含 A、B 和 C 的构建指令。该作业将由 A、B 或 C 的更改触发。
I assume that it is not to important, if your build doesn't happen right away. So you can change the scheduling for checking your SCM. So lets say A will be triggered to check the SCM daily at midnight. Then configure B for checking daily at 2am (depending on the build times for A) and C 2 hours later. Since you will have artifacts for A and B, C will build fine. For newly created jobs, you will have artifacts as well, since you need to test your configuration, you just trigger the first build manually.
If that is not an option, you can always build all 3 of them. Meaning you create job D which contains the build instructions for A, B and C. This job will be triggered by changes to A, B, or C.