TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Clean-Up

Last modified: 20 April 2023

Clean-Up is a process that is run regularly and removes clean-up rules-matching builds from the build configuration history. The process cleans build data stored on the server. This allows to clean disk space and remove obsolete builds from UI.

A clean-up policy defines how to clean up build data (build log messages, developers' changes, artifacts, statistical data and so on). The clean-up policy contains a number of rules, which can be defined for a specific build configuration, and a default policy for all build configurations. In each rule, you can define a number of successful builds to preserve, and/or a length of time that builds should be kept in history (e.g. keep builds for 7 days). These rules do not apply to pinned builds (see Pinned Build). Builds used as source for Configuring Dependencies in other builds are also preserved in history and don't depend on the clean-up policy.

Each clean-up rule defines data to clean up. The following options are available:

  • remove only the build artifacts

  • remove the build history entry (the build will be preserved only in the statistics charts)

  • remove everything

See Build History Clean-Up Policy for more details about clean-up policies configuration.

Clean-Up for Dependent Builds



TeamCity preserves builds that are used in other builds by either Dependent Build.

In addition, there is an option that allows to protect artifacts of the builds that were used as a source of artifact dependencies (See "Prevent dependency artifacts clean-up" option in Dependencies section of the Build History Clean-Up Policy). The option is ON by default.

Say, a build configuration A has an artifact dependency on B. If Prevent dependency artifacts clean-up option is enabled for A, the builds of B that provided artifacts for the builds of A will not be processed while cleaning artifacts, so that artifacts will be preserved.