Reputation: 213
So I've got a couple of projects (A, B, C, D) where the dependencies look like this:
B
/ \
A D
\ /
C
That is, B and C depend on artifacts from A, and D depends on artifacts from both B and C.
I'd like to do a couple of things:
I can achieve VCS triggered builds in the "Build Triggers" section.
I can achieve artifact dependencies in the "Dependencies" section by adding an artifact dependency from "Last successful build" and pulling over my artifacts.
I don't know how to achieve triggered builds in the correct order in the correct dependency chain. If I make project A a snapshot dependency of project B, when B needs to be built, it rebuilds A and then rebuilds B. Similarly, if a change happens in A, only A is rebuilt. I would like a change in A to cause a rebuild for all my projects.
Is this possible? I'm on TeamCity 7.1.3.
Upvotes: 1
Views: 2952
Reputation: 300
You can also use a VCS trigger. Set B and C have A as a snapshot dependency, and D with a snapshot dependency on B and C. Then set on all 4 a VCS build trigger, making sure to check the option "Trigger on changes in snapshot dependencies".
This way -
Change in A: A is rebuilt, this then triggers a build of B and C. These builds then also trigger a build of D, all in correct order.
Change in B or C: If A is unchanged, they use the existing build, rebuild themselves, and trigger build of D:
Change in D: If A, B, and C are unchanged, it uses the existing builds and builds a new D.
I'm using this setup on version 7.1.2
Upvotes: 3
Reputation: 213
It turns out that I can get what I want by using artifact dependencies and "Build Finished" build triggers.
Upvotes: 1