Jenkins根据构建参数触发构建 [英] Jenkins trigger build dependent on build parameters

查看:198
本文介绍了Jenkins根据构建参数触发构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jenkins管道,其设置如下,其中Build A是管道的开始,并在完成时触发build B,依此类推(见下文).到目前为止,我已经实现了Build A,B和C.使用Jenkins Parameterized Trigger插件作为构建后操作来触发我的构建.

I have a jenkins pipeline set up as follows where Build A is the start of the pipeline and on completion triggers build B and so on (see below)..So far I have implemented Build A, B and C. I have used the Jenkins Parameterized Trigger plugin as a post build action to trigger my builds.

在构建B完成之后,我是否仍然可以根据构建B之后在构建B之前用叉启动构建的哪些参数,如下所示. Build C和Build D是将部署到不同环境的部署版本.因此,如果将development作为参数传递给Build A,则它将调用Build C,否则,如果将测试作为参数传递,它将在Build B之后调用Build D.

Is there anyway that I can after Build B has completed depending on what parameters the build was kicked off with fork the build after build B as shown below. Build C and Build D are deployment builds which will deploy to different environments. So if develop was passed as a parameter to Build A then it would invoke Build C else if test was passed as a param it would invoke Build D after Build B.

曾经四处张望,无法看到任何想法的人

Been looking around and cant see how to do this anyone any ideas

谢谢

Parameterised Build A eg: Params a=1 b=2
              |
              |
Parameterise Build B (uses params from build A)
              |
              |
    ------------------------
    |                       |
    |                       |


Build C                   Build D

推荐答案

我使用了灵活的发布者插件,并在参数名称上使用了regualr表达式来决定要触发哪个版本.类似于我认为条件插件

I did this using the flexible publisher plugin and using a regualr expression on the parameter name to decide which build to trigger. Similar to I think the conditional plugin

这篇关于Jenkins根据构建参数触发构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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