如何以某种预定义的顺序在 Hudson 中运行作业?

发布于 2024-08-21 09:37:33 字数 335 浏览 5 评论 0原文

有 4 个作业:

Build1  
Build2  
Test1  
Test2

Build1Build2 可以同时启动。
仅当 Build1Build2 都完成时才开始 Test1
仅当 Tes1 完成时才应启动 Tes2
我也希望能够单独开始所有这些工作。
有什么办法可以根据这些规则设置工作吗?

There are 4 jobs:

Build1  
Build2  
Test1  
Test2

Build1 and Build2 can be started simultaneously.
Test1 should be started only when both Build1 and Build2 will be finished.
Tes2 should be started only when Tes1 will be finished.
Also I would like to have ability to start all of these jobs separately.
Is there any way to setup jobs according these rules?

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

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

发布评论

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

评论(5

一抹苦笑 2024-08-28 09:37:33

创建新作业时,您通常可以指定必须构建哪些上游项目才能开始此作业。

该选项位于构建触发器->创建/修改作业时,在构建其他项目之后构建

When creating a new job, you normally can specify what upstream project must be built in order to begin this job.

This option is in Build Triggers -> Build after other projects are built when creating/modifying a job.

波浪屿的海角声 2024-08-28 09:37:33

我认为你有几种选择。我的假设是,我们正在谈论长时间运行的作业,否则我只会将它们串在一起作为一项庞大的作业(一项作业中的多个构建步骤)并创建单独的作业来单独运行它们。

如前所述,对于长时间运行的作业,请查看加入插件。作为一般参考,有一个页面解释了为什么要将测试作业与构建作业分开。请参阅此处

I think you have several options. My assumption is, that we are talking about long running jobs, otherwise I would just string them together as one monster job (several build steps in one job) and create separate jobs for running them individually.

As mentioned, for long running jobs, have a look at the join plugin. As a general FYI there is a page explaining why you want to separate testing jobs from the building jobs. See here.

入画浅相思 2024-08-28 09:37:33

“Promoted Builds Plugin”可能是一个很好的解决方案:您可以将主作业“Build”配置为不执行任何操作,而是启动 2 个下游构建“Build1、Build2”(在构建后操作中)。
然后,您必须添加一个升级流程“当以下下游项目成功构建时”,选择“Build1、Build2”,并关联下游构建操作“Test1”。
如果“Build1”和“Build2”构建成功(状态均为 STABLE),则“Build”将被提升,“Test1”将被排队。
最后,您触发 Test2 作为 Test1 的构建后操作。

但您必须注意,在许多“Build”实例排队的情况下,您不能依赖于lastSuccessful构建永久链接(当第一个“Build”调用“Test1”时,下一个“Build1”或“Build2”可能已经构建”将从队列中弹出),并且您将必须设计一种方法来跟踪您正在测试的构建的修订版本。

参数化触发器插件可以帮助解决这个问题:例如,您可以将上游构建的 id 作为参数传递。

The "Promoted Builds Plugin" can be a good solution: you can configure a master job "Build" to do nothing but start 2 downstream builds "Build1, Build2" (in post-build actions).
Then you have to add a promotion process "When the following downstream projects build successfully" selecting "Build1, Build2", with an associated downstream build action of "Test1".
If "Build1" and "Build2" build sucessfully (both status STABLE), "Build" will be promoted and "Test1" will be enqueued.
Finally, you trigger Test2 as a post-build action of Test1.

But you have to be aware that is case many instances of "Build" are enqueued, you cannot rely on the lastSuccessful build permalink (the next "Build1" or "Build2" may already be built when "Test1" called by the first "Build" will pop-out of the queue), and you will have to devise a way to keep track of the revision of the build you are testing.

Parameterized Trigger Plugin can help solving this problem: you could pass the id of the upstream build as a parameter, for example.

忆梦 2024-08-28 09:37:33

我正在运行 Hudson 1.346 版本。

您可以在“构建触发器”下选中“在构建其他项目后构建”。

它说“可以指定多个项目,如‘abc, def’”,

因此您应该能够将“Build1、Build2”添加到 Test1 配置中的该字段中。

I'm running version 1.346 of Hudson.

You can check 'Build after other projects are built' under 'Build triggers'.

It says that "Multiple projects can be specified like 'abc, def'"

So you should be able to add 'Build1, Build2' to that field in the configuration for Test1.

时光瘦了 2024-08-28 09:37:33

您可以保留您的 Test1 和 Test1 Test2 作为单独的作业,而不是构建的一部分。

当 Build1 和 Build2 完成后,Test1 可以作为下游构建启动。 Test2 可以是 Test1 的下游作业。

You could keep your Test1 & Test2 as separate jobs, instead of being a part of the builds.

When Build1 and Build2 are complete, Test1 can start as a downstream build. Test2 can be a downstream job from Test1.

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