在 TeamCity 中多次并行构建后触发后续构建 [英] Trigger subsequent build once after multiple parallel builds in TeamCity
问题描述
我收集了 150 多个项目,将它们重新配置并优化为多个 TeamCity 配置,以及多个构建代理,以尝试提高我们目前以高度顺序方式构建的构建服务器性能.
We have over 150 projects which I have gathered together, reconfigured and optimised into multiple TeamCity configurations, with multiple build agents, to try to improve our build server performance which currently builds in a highly sequential manner.
技术(Web、dotNet、VB6 和 COM+)和系统架构的混合意味着现在可以并行运行的各种步骤(配置),但需要进一步整合.
The mix of technologies (Web, dotNet, VB6 and COM+) and system architecture means that there are various steps (configurations) which can now run in parallel but which need to come together further down the track.
这是一个非常简化的依赖场景,但代表了我们遇到的一个问题......
This is a very simplified dependency scenario but representative of a problem we have....
A -> B -> Collate (-> Deploy)
A -> C -> Collate (-> Deploy)
问题在于,如果对 A 进行更改,将导致 B 和 C 都触发,这将导致 Collate(和 Deploy)步骤运行两次,尽管在 A 中是一个常见的触发器.正如我所说,这是对近 20 种实际配置的简化,频繁的重建影响了速度的提高.
The issue is that, if a change is made to A, it will result in B and C both triggering which will result in the Collate (and Deploy) steps running twice, despite being a common trigger in A. As I say, this is a simplification of the real set of almost twenty configurations and the frequent rebuilds are impacting the speed improvements.
任何人都可以提出任何方法来确定 B 和 C 都将作为 A 的结果被触发的事实,并在触发 Collate 步骤之前让 Collate 步骤等待 B 和 C 都完成?显然,对 B 或 C 的更改应该能够独立触发 Collate.
Can anyone suggest any way that I can identify the fact that both B and C will be triggered as a result of A and make the Collate step wait for both B and C to complete before triggering the Collate step? Obviously a change to B or C should be able to trigger the Collate independently.
推荐答案
我是 TeamCity 的新手,但我相信这就是你所需要的:
I'm new to TeamCity, but I believe that this is what you need:
A
:没有触发器或依赖项B
和C
:没有触发器,快照依赖于A
Collate
:VCS 触发器,快照依赖于B
和C
A
: no triggers or dependenciesB
andC
: no triggers, snapshot dependecies onA
Collate
: VCS trigger, snapshot dependency onB
andC
使用该设置,VCS 单次推送将导致:
With that setup, a VCS single push will result in:
- 正是
A
、B
、C
和Collate
的一个版本 A
在B
和C
之前构建B
和C
在Collate
之前构建- 全部从 VCS 中的同一点构建
- exactly one build of
A
,B
,C
andCollate
A
built beforeB
andC
B
andC
built beforeCollate
- all built from the same point in VCS
如果您想将工件沿链向下传递,那么您还需要定义工件依赖项.
If you want to pass artifacts down the chain then you will need to define artifact dependencies as well.
如果不同的构建使用不同的 VCS 存储库,那么您仍然不应该在 A
、B
和 C
上设置 VCS 触发器;相反,您在 Collate
的 VCS 触发器上设置了Trigger on changes in snapshot dependencies"选项.
If the different builds use different VCS repositories, then you still should not set VCS triggers on A
, B
and C
; instead you set the "Trigger on changes in snapshot dependencies" option on the VCS trigger for Collate
.
这篇关于在 TeamCity 中多次并行构建后触发后续构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!