TeamCity 4.0 Help

Build Chain

Build chain is a sequence of builds interconnected by Dependent Build. Thus, all the builds in a chain use the same sources snapshot.

The most common use case for specifying a build chain is running the same test suit of your project on different platforms. For example, you may need to have a release build and want to make sure the tests are run correctly under different platforms and environments. For this purpose, you can instruct TeamCity firstly run an integration build and after that a release build.

Let's see how the build chain mechanism works in details. On triggering one dependent build of the "A" build configuration, TeamCity does the following:

  1. Resolves a chain of all build configurations that "A" configuration depends on.

  2. Checks for changes for all dependent build configurations and synchronizes them when a first build in a build chain enters a build queue.

  3. Adds all the builds that need building with specific revisions to the build queue.

Configuring Build Chains

In TeamCity, you can configure dependent builds when creating/editing build configuration and specify two different types of dependencies, namely:

  • Artifact dependencies

  • Snapshot dependencies

To specify the dependencies in your build configuration:

  1. Navigate to the Administration and create a new build configuration or for the already existing build configuration, navigate to the edit link, click the arrow icon to access the drop-down list and select Dependencies.

  2. On the Dependencies page which opens click the add new dependency link under the Snapshot Dependencies or Dependencies by Artifacts.

Stopping/Removing From Queue a Build from Build Chain

If a build being stopped or removed from build queue is a part of Build Chain, there is a message below comment field: This build is a part of a build chain.

If there are other running or queued parts of the build chain (i.e. other running builds or queued builds, which are connected with the build under the action), these builds will be listed below under the label: Stop other parts:.

If user has access rights to stop a build in the list, there is a checkbox near it. The checkbox is selected by default, if stopping the current build will definitely cause the build in the list to fail (for instance, if listed build depends on the original build being stopped).

If user has no access right to stop a build from the list, checkbox is not visible.

Selecting the checkbox marks the selected build for stop/removal from queue.

If user has no "View" access right for a build, which is a part of the build chain, this build is not listed at all. If there is at least one such build, we show a yellow stripe with warning: You don't have access rights to all its parts. The stripe is shown right under the message "This build is a part of a build chain".

In the case, when all other parts of the build chain cannot be viewed by the current user, we show a yellow stripe with warning: You don't have access rights to see its other parts.

If there is no running or queued builds for the build chain (i.e. all other parts of the build chain has finished), no additional information is shown.

Last modified: 20 April 2023