如何在MultiJob插件中传递内部版本号? [英] How to pass a build number within the MultiJob plugin?

查看:169
本文介绍了如何在MultiJob插件中传递内部版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MultiJob插件很棒,我想将其用于我的构建过程,但是我必须解决一个问题:三个作业A,B和C.SVN触发作业A和B(并行执行),并且作业C在A和B完成后开始.作业C需要来自作业A和B的工件作为输入.

The MultiJob plugin is great and I want to use it for my build process, but there is one issue I have to solve before: There are three jobs A, B and C. SVN triggers job A and B (parallel execution) and job C starts when A and B have finished. Job C requires the artifacts from job A and B as an input.

          -> Job A (with A.zip) 
Trigger                          -> Job C (use artifacts A.zip and B.zip)
          -> Job B (with B.zip)

使用 MultiJob插件来设计工作流程很容易,但是我不知道如何从作业C中的作业A和B中获取相应的工件.我可以将内部版本号传递给作业C(buildNr(A)!= buildNr(B))吗?还是有更聪明的方法来解决这个问题?

To design the workflow with the MultiJob plugin is easy, but I have no clue how to get the corresponding artifacts from job A and B in job C. Can I pass the build numbers to job C (buildNr(A) != buildNr(B))? Or is there a smarter way to solve the issue?

推荐答案

multijob插件为每个作业设置以下环境变量(

The multijob plugin sets the following environment variables per job (code):

  • <JOBNAME>_BUILD_NUMBER
  • <JOBNAME>_BUILD_RESULT
  • <JOBNAME>_BUILD_NUMBER
  • <JOBNAME>_BUILD_RESULT

其中JOBNAME是由作业名称创建的,所有非字符和数字均用_替换.因此,您可以将内部版本号作为参数传递给作业C:

Where JOBNAME is created by the name of the job with all non characters and numbers replaced with _. Thus you can pass the build numbers as parameters to Job C:

这篇关于如何在MultiJob插件中传递内部版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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