Search code examples
build.gradleteamcity-9.0

TeamCity: Build only when changes are available


I have the following structure in my TeamCity

Commons
 * Commons Release Build (takes quite long because of integration tests)
Applications
 * AppA Release Build
 * AppB Release Build
 * AppC Release Build

All three (independent) Applications depends on the Commons-Release-Build. Currently, the single Applications trigger the Commons-Release-Build before building. But in most cases the Commons-Release-Build hasn't changed, so it is unnecessary to rebuild it.

Is it somehow possible to configure Teamcity so it triggers the commons-release-build only when changes are available? Or is it possible to tell the commons-release-build to do nothing when no changes are available?

NOTE: Gradle is used for every build.

Thanks in advance Guenther


Solution

  • Answer to my own question: It is possible to trigger the commons-build, and say "only build when changes are available", but the better solution is to configure the commons-library not to build at all but to be triggered by the depending projects when changes are detected. So do

    • Disable VCS-Triggers in commons
    • Create VCS-Triggers in the depending projects
      • enable the Flag "Trigger a build on changes in snapshot dependencies" on all the VCS-Triggers of the depending projects