Build Checkout Directory

Search
Searching TeamCity 4.x Documentation
Table of Contents

The build checkout directory is the directory where all of the project's sources reside. If the VCS checkout mode property of the build configuration is set to Automatically on server or Automatically on agent, TeamCity places the sources into the checkout directory according to the mapping defined in the VCS Checkout Rules.

If not specified, automatically created directory is used with a generated name: <agent working directory>/<VCS settings hash code>. The VCS settings hash code is calculated based on VCS roots and VCS settings used by the build configuration. Effectively, this means that the directory is shared between all the build configurations with the same VCS settings.

If you need to know the directory used by a build configuration, you can refer to <agent working directory>/directory.map generated file which lists build configurations with the directory used by them.

If for some reason default directory does not match your requirements (for example, the process of creating builds depends on some particular directory), you may want to specify your own build checkout directory.

Please ensure that the checkout directory is not shared between build configurations with different VCS settings. Please also ensure that the content of the directory is not modified by other processes.
Otherwise, the directory content may get out of sync with the state TeamCity think it is in and the files may not be updated to the state necessary for a build. In this case Clean Checkout will be necessary.

As a kind of failover measure TeamCity automatically performs Clean Checkout, if it finds files of another build configuration in the current checkout directory or the directory is empty.

In your build script you may refer to the effective value of build checkout directory via the teamcity.build.checkoutDir property provided by TeamCity.

The checkout directory is automatically cleaned up if not used (no builds use it as checkout directory) for a specified period of time (by default it is two weeks). The time frame can be changed by specifying teamcity.agent.build.checkoutDir.expireHours agent property.



See Also:

Labels