How to skip building configurations which sources were not changed since the last successful build?
Despite the effort I still cannot full grasp the logic behind TeamCity build dependencies.
Example#1: We have standalone build configuration triggered by schedule. How to skip the build if source code was not changed since the last successful build?
Example#2: We have build chain connected by Snapshot Dependencies. Every time the sources for one build configuration get changeв the whole chain is built, including those configurations which sources barely ever change. How to avoid wasting time and resources?
Example#3: We have three build configurations which run different kinds of tests against the artifact from some primary build. How to initiate deployment "build" of that artifact only when all three "test" builds were successful? Or even more specifically - how to find (and deploy) the latest build for which all three test builds (potentially running in parallel on different agents) finished sucessfully.
In many cases it feels like "existing suitable build" is present, but TC does not take it as suitable.
Could somebody please clarify the confusion?
Thank you!
Konstantin
Please sign in to leave a comment.
Hi Konstantin,
For more details and examples please read these sections https://confluence.jetbrains.com/display/TCD9/Build+Dependencies+Setup, https://confluence.jetbrains.com/display/TCD9/Dependent+Build.
Alina, thank you very much for your answer. Now I need some time to experiment with those settings and see if I get what I want.
My primary concern is not scheduled build, but rather Deployment build triggered by VCS which has lots of Snapshot dependencies (direct and indirect) on other builds (components and tests). It is really confusing that it initiates build of ALL snapshot dependencies ignoring the fact that most of them are already built from the latest sources and do not need to be built again. I.e. the option "Do not run new build if there is a suitable one" seems to be too picky and rejects available builds which are otherwise totally suitable for consumption by Deployment.
Is there a way (through some verbose logging maybe?) to find out why existing build was not considered suitable and was rebuilt?
Thank you!
Konstantin
Konstantin,
Unfortunately at the moment we do not provide details why the build is not considered suitable. Please vote for the feature request: https://youtrack.jetbrains.com/issue/TW-37419. Also please vote for the related request: https://youtrack.jetbrains.com/issue/TW-35216.
Alternatively, it is possible to promote a finished build through its “Build Actions” and invoke configurations which are snapshot dependent on it. In this case the build chain won't be rebuild. Please find more details here: https://confluence.jetbrains.com/display/TCD9/Triggering+a+Custom+Build#TriggeringaCustomBuild-PromotingBuild
Is there a way to Promote a build automatically (without TC UI) using some kind of trigger?
In TemCity 9.1 EAP1 we have improved Scheduled Trigger to solve this request (also see suggested workaround in comments). The Schedule Trigger has got an ability to watch for builds in other build configurations and trigger a build if these builds change.
The watched build in this trigger will be promoted to a triggered build if there is an artifact or snapshot dependency on the watched build in the configuration where the trigger is defined.