Hudson / Jenkins - 并行与串行管道以及作业的重用

发布于 2024-12-09 15:43:14 字数 746 浏览 1 评论 0原文

我想运行一系列 Hudson 作业来测试各种构建:

  1. 在 Server X 上构建 1.17
  2. 在 Server X
  3. Test1
  4. Test2

上构建 Trunk我想串联运行这些作业,每个作业等待另一个作业完成: Build 1.17 ,Test1,Test2,Build Trunk,Test1,Test2

另一方面,我还有另外两个作业Test3和Test4,它们可以并行运行,就在Build Trunk之后。

我不想将每个作业的构建后步骤部分中的多个作业链接在一起,但这是我可以使它们串联运行的唯一方法。这样做的问题是: 1)作业重复:我需要Test1和Test2的2份:Build 1.17->测试1->测试2->构建主干 -> Test1(中继副本)-> Test2(中继的副本)。 2) 更多重复:我需要另一个构建主干,这样我就不会每次想运行 Test3 和 Test4 时都运行 Test1。

是否有一种简单的方法可以让作业串行运行,而无需修改各个作业并在顶级作业之外创建它们之间的依赖关系?

这样的事情可能吗

更新: 最终我们所做的是使用 Rakefiles 来管理整个过程。没有一个插件足够强大来实现这一点。一个 hudson 作业调用带有参数的 Rakefile,该参数又调用其他 hudson 作业。

I have a series of Hudson jobs I want to run to test out various builds:

  1. Build 1.17 on Server X
  2. Build Trunk on Server X
  3. Test1
  4. Test2

I want to do run these jobs in series with each job waiting for the other to finish: Build 1.17, Test1, Test2, Build Trunk, Test1, Test2

On the other hand, I have two other jobs Test3 and Test4, which can be run in parallel, and just after Build Trunk.

I'd prefer not to have to chain multiple jobs together from the post-build-steps section of each job, but this is the only way I can make them run in series. The problems with this are:
1) Job Duplication: I need 2 copies of Test1 and Test2: Build 1.17-> Test1 -> Test2 -> Build Trunk -> Test1 (copy for trunk) -> Test2 (copy for trunk).
2) More Duplication: I need another Build Trunk so I don't run Test1 every time I want to run Test3 and Test4.

Is there a simple way to have jobs operate in series without modifying the individual jobs and creating dependencies between them outside of a top-level job?

Is such a thing even possible

UPDATE: Eventually what we did is use Rakefiles to manage the whole process. None of the plugins were robust enough for this. A hudson job calls a Rakefile with args which calls other hudson jobs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等往事风中吹 2024-12-16 15:43:14

看看锁和闩锁插件 - 这个允许您设置更复杂的构建依赖项,而无需重复作业。

Have a look at the Locks and Latches plugin - this lets you set up more complex build dependencies without having to duplicate your jobs.

尴尬癌患者 2024-12-16 15:43:14

查看(相对较新的)多作业插件。然后,您可以定义多个串行执行的阶段,一个阶段内的所有作业并行运行。对于您的示例,设置 6 个阶段。第 1 阶段运行 Build 1.17,第 2 阶段运行测试 1,等等。在第 5 阶段(在 Build Trunk 之后),您可以并行运行测试 3 和测试 4。

或者,使用 构建管道插件 构建两个单独的管道来启动每个管道手动。

顺便说一句,Locks and Latches 插件已被弃用,由 Throttle Concurrent Builds 插件取代。这可以避免在同一个从属设备上同时运行测试 3 和测试 4 作业(并使从属设备过载)。

Have a look at the (relatively new) Multijob Plugin. You can then define multiple phases that get executed in series, with all jobs within a phase running in parallel. For your example, set up 6 phases. Phase 1 running Build 1.17, phase 2 running Test 1, etc. In phase 5 (after Build Trunk), you can run Test 3 and Test 4 in parallel.

Alternatively, build two separate pipelines with the Build Pipeline Plugin to start each pipeline manually.

BTW, the Locks and Latches plugin is deprecated, superseded by the Throttle Concurrent Builds Plugin. This works as a charm to avoid for instance running Test 3 and Test 4 jobs together on the same slave (and overload the slave).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文