2

我必须实现以下目标:我有一个具有两个配置 C1 和 C2 的多配置项目 A,现在对于每个成功的配置,我想构建另一个项目 B,例如:

  • 如果 C1-success 和 C2-fails 则 C1 --> B
  • 如果 C1-fail 和 C2-success 则 C2 --> B
  • 如果 C1-success 和 C2-success 然后 C1 --> B 然后 C2 --> B (一次只能运行一个 B 实例)

当前,如果其中一项配置失败,则父项将被标记为失败,从而停止触发下游项目。

4

1 回答 1

0

您可以使用参数化触发器插件在 C 的末尾触发作业 B,并将参数传递给 B,这是 C 中矩阵参数的名称 - 这是以标签名称命名的

至于多个作业 B 一起运行,如果您在作业 B 中未选中“如果需要”复选框,则保持并发运行就可以了


编辑

似乎插件在不使用参数的情况下支持这个本机 - 来自插件页面

Use of the plugin in a Matrix job
Post build task
When using the trigger parameterized build as a post build task for a matrix job the
triggering will be be done
once when all of the different matrix configurations have completed.
In this case some of the Environment variables may not be resolvable as passing them 
to downstream jobs will fail.

Environment variables that should be available are the the default shell ones
(<yourserver:port>/env-vars.html) and ones defined as Parameters.
Variables added by the other plugins as a buildwrappers may not be available.

Build step
When using the trigger parameterized build as a buildstep it will be called for 
every different configuration, so if triggering another project with no parameters it 
will be done the same number of times as you have configurations, possible causing the
triggered job to run more than once.

However this also allows you to trigger other jobs with parameters relating to the 
current configuration, i.e. triggering a build on the same node with the same JDK.
于 2014-01-21T10:04:22.527 回答