Snapshot dependency subject to changes condition
I'm sorry if this is a duplicate, but I could not find a solution to my problem.
We have a deploy build that depends on two independent test builds, say TestA and TestB. Now, TestA runs a normal, local test suite that takes some minutes and we want to run it on every commit on the default branch. TestB instead test a very specific part of the repository that is well isolated; this test takes a lot of time and uses external resources, which means it actually costs us a measurable quantity of money. We run TestB only if that part of the repository has changes.
So, while TestA has a trigger on all Git commits, TestB has a trigger subject to changes to that part of the repository. We would like the deploy build to depend on both TestA and TestB, but TestB should be only run if there were changes in the corresponding part of the repository with respect to the previous successfull deploy. This would require some sort of conditional snapshot dependency. Is this possible?
Please sign in to leave a comment.
Hi Andyspiros,
It sounds like you're on the right track. What you might need to add is a checkout rule to one or more of the build configurations, depending on the relationship of A and B. The checkout rules in TeamCity allow you to specify where changes will be detected by the VCS triggers. https://www.jetbrains.com/help/teamcity/vcs-checkout-rules.html#vcs-checkout-rules.md
There is actually an example similar to yours using checkout rules in a recent blog post that you may find helpful.
https://blog.jetbrains.com/teamcity/2019/09/build-chains-teamcitys-blend-of-pipelines-part-1-getting-started