简体   繁体   English

1个jenkins作业根据参数触发多个jenkins作业

[英]1 jenkins job trigger multiple jenkins jobs based on parameters

Is there any Jenkins plugin that helps with the following: 有没有任何Jenkins插件可以帮助您解决以下问题:

  • if a directory <XXX* , is present in SVN folder <GoRoCo> 如果目录<XXX* ,则存在于SVN文件夹<GoRoCo>
  • then the <GoRoCo>_<XXX> Jenkins job is called ? 然后<GoRoCo>_<XXX> Jenkins作业?

Example: 例:
In job "TEST" , I specify parameters like directory name (A, B , C) and folder name (G1R2) then job "TEST" should trigger the jobs "G1R2_A" , "G1R2_B" and "G1R2_C" 在作业"TEST" ,我指定目录名称(A,B,C)和文件夹名称(G1R2)等参数,然后作业"TEST"应触发作业"G1R2_A""G1R2_B""G1R2_C"

Use Parameterized Trigger Plugin . 使用参数化触发器插件 When specifying jobs to call in the plugin you can use tokens, as in JOB_${PARAM1}_${PARAM2} . 指定要在插件中调用的作业时,可以使用标记,如JOB_${PARAM1}_${PARAM2}

Take a look at that plugin, i think it does exactly what you are looking for: 看看那个插件,我认为它完全符合您的要求:

https://wiki.jenkins-ci.org/display/JENKINS/Files+Found+Trigger https://wiki.jenkins-ci.org/display/JENKINS/Files+Found+Trigger

Use Build Flow plugin 使用Build Flow插件

With the help this plugin you can run as many jobs with or without parameter. 有了这个插件的帮助,您可以运行带有或不带参数的多个作业。

Use some scripts to create property file with the required parameters for each of the modified project and place them in the workspace directory. 使用一些脚本为每个已修改项目创建包含所需参数的属性文件,并将它们放在工作空间目录中。

Later you can use parameterised plugin to trigger downstream project like this. 稍后您可以使用参数化插件来触发此类下游项目。

在此输入图像描述

Note: you might also have to delete those properties after triggering the down stream projects. 注意:您可能还必须在触发下游项目后删除这些属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM