Trigger subsequent build once after multiple parallel builds in TeamCity

匿名 (未验证) 提交于 2019-12-03 02:52:02

问题:

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.

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) 

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.

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.

回答1:

I'm new to TeamCity, but I believe that this is what you need:

  • A: no triggers or dependencies
  • B and C: no triggers, snapshot dependecies on A
  • Collate: VCS trigger, snapshot dependency on B and C

With that setup, a VCS single push will result in:

  • exactly one build of A, B, C and Collate
  • A built before B and C
  • B and C built before Collate
  • 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.

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!