Reputation: 8246
I am automating the build of my .net core solution using TeamCity v10:
lets say i have the following projects:
A -> B -> C ->D
A->D
The arrow indicates that Project B references project A and needs it be restored and built before.
Configuration
Project D is a web application that has to be published at the end (it also needs both C and A)
Snapshot Dependencies
Any build on projects that are referenced should trigger build on the dependent projects in order to make sure that changes would not cause other projects to break.
For this case, I created the following snapshot dependecies:
If I trigger a build on A, its triggering another builds on the build Chain (Which is A->B ->C -> D).
Then, If I trigger C, its triggering only D.
However If I start from B, Or C without having done the trigger of A first, the build of B fails since it needs project A Output First.
Questions:
Upvotes: 1
Views: 135
Reputation: 8246
The solution is to configure snapshot dependencies from B to A, from C to B, and from D to C. However, the dependency from D to A is excessive, because the whole build chain runs on the same revision.
If build B is triggered, then all build up the chain (A and B) should. There can be an option "Do not run new build if there is a suitable one" enable. In this case build B will reuse suitable build A, if it exists.
Regarding triggers:
In this case if there are VCS changes in any build (A, B, C or D) the whole build chain will be triggered.
Upvotes: 1