Jenkins - 同时运行单个构建的实例 [英] Jenkins - Running instances of single build concurrently
问题描述
我希望能够同时运行同一个 Jenkins 作业的多个构建.
I'd like to be able to run several builds of the same Jenkins job simultaneously.
示例:
- 构建[*jenkins_job_1*]:调用带有参数'A'的ant脚本
- 构建[*jenkins_job_1*]:调用带有参数'B'的ant脚本
- 根据需要重复
- 作业的每个实例同时运行,而不是通过队列运行.
我想这样做的原因是为了避免创建几个几乎相同的工作,所有这些工作都需要维护.
The reason I'd like to do this is to avoid having to create several jobs that are nearly identical, all of which would need to be maintained.
有没有办法做到这一点,或者可能是另一种解决方案(即 - 从基础作业动态创建作业并在完成后将其删除)?
Is there a way to do this, or maybe another solution (ie — dynamically create a job from a base job and remove it after it's finished)?
推荐答案
Jenkins 有一个复选框:如有必要,执行并发构建"
Jenkins has a check box: "Execute concurrent builds if necessary"
如果您选中此项,它将为一个作业启动多个构建.
If you check this, then it'll start multiple builds for a job.
这适用于此构建已参数化"复选框.
This works with the "This build is parameterized" checkbox.
您仍然会触发构建,将您的 A
或 B
作为参数传递.您可以使用其他作业来触发它们,也可以通过脚本手动执行.
You would still trigger the builds, passing your A
or B
as parameters. You can use another job to trigger them or you could do it manually via a script.
这篇关于Jenkins - 同时运行单个构建的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!