[英]how to trigger jenkins downstream job only both upstreams jobs successfully executed
I have created Job A which looks for upstream jobs (Job B and Job C) success result and triggers a shell script to verify a condition. 我创建了作业A ,该作业寻找上游作业(作业B和作业C)成功的结果,并触发Shell脚本来验证条件。
Once Job B and Job C executed successfully Job A executes downstream jobs (Job D and Job E) . 一旦作业B和作业C成功执行, 作业A将执行下游作业(作业D和作业E) 。
I have used reverse
(to configure upstream jobs) and downstream-ext
(to configure downstream jobs) plugins in Job A using JJB. 我已经在作业A中使用JJB使用了
reverse
(用于配置上游作业)和downstream-ext
(用于配置下游作业)插件。
Issue I am facing here is: After Job B is executed successfully without waiting for Job C result. 我在这里面临的问题是:作业B成功执行后,没有等待作业C结果。 Job A should wait for both Job B and Job C and then execute based on the result.
作业A应同时等待作业B和作业C,然后根据结果执行。
Could you please help me how to configure this scenario. 您能否帮助我如何配置此方案。
You can try using the Join Plugin, here is the documentation: 您可以尝试使用Join插件,这里是文档:
https://wiki.jenkins-ci.org/display/JENKINS/Join+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Join+Plugin
This'd be easier if you convert your A job to a build flow https://wiki.jenkins.io/display/JENKINS/Build+Flow+Plugin?focusedCommentId=60917290 or even better it's successor Pipeline 2.0 https://jenkins.io/doc/book/pipeline/ 如果您将A作业转换为构建流程,这会更容易https://wiki.jenkins.io/display/JENKINS/Build+Flow+Plugin?focusedCommentId=60917290甚至更好,它是Pipeline 2.0的后继者https:// jenkins .io / doc / book / pipeline /
(Groovy) Code in A would then be something like: (Groovy)A中的代码将类似于:
if (build('scenario-B-Job') && build('scenario-C-Job')) {
build('scenario-E-Job')
build('scenario-D-Job')
} You can also parallelize (B,C and then D,E) to shorten overall execution times if you have enough slaves around. }如果周围有足够多的从属服务器,则还可以并行化(B,C,然后是D,E)以缩短总体执行时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.