运行jenkins并行作业并从不同的服务器等待

时间:2014-07-27 14:33:06

标签: batch-file jenkins command jenkins-plugins

我需要使用Jenkins进行构建和部署。但我需要为这个工作流程设计。

JOB 1 (primary build from A server)
 |------> JOB A (deploy)
 |------> JOB B (deploy)

JOB 2 (delta build from B server)
 |------> JOB C (deploy)
 |------> JOB D (deploy)

Job 3 (this should execute upon JOBS A B C D are successful).

当构建在2台服务器中生成时,JOB 1和作业2在2台服务器中配置。我有一个可以同时完成JOBS 1和JOB的JOB。 2,我们如何才能实现JOB 3的执行。

任何想法?

或者可以像这样配置

JOB Main-- |
           |--->JOB 1 (primary build from A server)
                  |------> JOB A (deploy)
                  |------> JOB B (deploy)

           |--->JOB 2 (delta build from B server)
                  |------> JOB C (deploy)
                  |------> JOB D (deploy)
           |---> JOB 3 (upon completing the JOB 1,2 and JOB A B C D)

屏幕截图会有所帮助。

提前致谢。

1 个答案:

答案 0 :(得分:0)

实际上,这是一种不使用任何特定插件的简单方法。

您可以让作业在执行完毕时创建特定文件,如

JobA_Success.txt,

JobB_Success.txt,

JobC_Success.txt和

JobD_Success.txt

Job Main

  |    
   --> Job 1 (Job A and Job B) triggers Job 3 after execution

   --> Job 2 (Job C and Job D) triggers Job 3 after execution


Job 3 --> Uses a script trigger which will check for all the 4 text files to be present and only if present it will start building otherwise there is no new build.

这只是一个逻辑思考,希望它有用