怎样使多个同时发生的上游作业后,詹金斯作业开始成功吗? [英] How do I make a Jenkins job start after multiple simultaneous upstream jobs succeed?

查看:116
本文介绍了怎样使多个同时发生的上游作业后,詹金斯作业开始成功吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了获得最快的反馈可能,我们偶尔想詹金斯作业并行运行。詹金斯有当一个作业完成启动多个下游作业(或叉管道)的能力。然而,詹金斯似乎并不具有使下游的作业只启动叉各分公司的成功(或加入叉重新走到一起)的任何方式。

In order to get the fastest feedback possible, we occasionally want Jenkins jobs to run in Parallel. Jenkins has the ability to start multiple downstream jobs (or 'fork' the pipeline) when a job finishes. However, Jenkins doesn't seem to have any way of making a downstream job only start of all branches of that fork succeed (or 'joining' the fork back together).

詹金斯有一个构建后其他项目都建按钮,但我间preT,作为启动此作业时的任何上游作业完成(不是什么时候开始这项工作所有上游作业成功)。

Jenkins has a "Build after other projects are built" button, but I interpret that as "start this job when any upstream job finishes" (not "start this job when all upstream jobs succeed").

下面是我在谈论的可视化。有谁知道,如果一个插件存在这样做的我后?

Here is a visualization of what I'm talking about. Does anyone know if a plugin exists to do what I'm after?

当我最初发布这个问题在2012年,贾森的回答(在加入和促进构建插件)是最好的,而且该解决方案我就去了。

When I originally posted this question in 2012, Jason's answer (the Join and Promoted Build plugins) was the best, and the solution I went with.

不过,dnozay的回答(编译流程插件)就是这个问题,这是一个更好的答案了一年左右后作出受欢迎。对于它的价值,如果人们今天问我这个问题,我现在建议吧。

However, dnozay's answer (The Build Flow plugin) was made popular a year or so after this question, which is a much better answer. For what it's worth, if people ask me this question today, I now recommend that instead.

推荐答案

有,我已经使用了这种情况在过去的两个解决方案:

There are two solutions that I have used for this scenario in the past:


  1. 使用加入你的部署工作插件并注明推广作为目标作业。你将不得不指定功能测试和性能测试作为参加工作,并通过某种方式,生成后启动它们。该参数触发插件是好这一点。

  1. Use the Join Plugin on your "deploy" job and specify "promote" as the targeted job. You would have to specify "Functional Tests" and "Performance Tests" as the joined jobs and start them via in some fashion, post build. The Parameterized Trigger Plugin is good for this.

使用促进了构建于你的部署工作插件,指定推广时,下游作业完成,并指定功能和性能测试作业工作。作为促进行动的一部分,触发促进的工作。你仍然需要从开始部署

Use the Promoted Builds Plugin on your "deploy" job, specify a promotion that works when downstream jobs are completed and specify Functional and Performance test jobs. As part of the promotion action, trigger the "promote" job. You still have to start the two test jobs from "deploy"

还有就是这两种解决方案的一个重要方面:指纹必须正确使用。以下是我发现的:

There is a CRITICAL aspect to both of these solutions: fingerprints must be correctly used. Here is what I found:


  1. 建工作必须发起新按手印的文件。换句话说,它具有对指纹一些文件詹金斯认为起源由初始作业。仔细检查作业。请指纹链接验证这一点。

  2. 所有下游链接任务(在此情况下,部署,功能测试和性能测试)需要获得和指纹此相同的文件。复制文物插件是伟大的,这样的事情。

  3. 请记住,有些插件允许你改变指纹和下游工作启动的顺序;在这种情况下,下游的工作指纹相同的文件之前,确保指纹的起源是正确设置必须进行指纹识别。

这篇关于怎样使多个同时发生的上游作业后,詹金斯作业开始成功吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆