Michael Edwards
Michael Edwards

Reputation: 6518

Team City Artifact Limit

I need to limit the number of Artifacts a particular build is keeping. This one build generates very large artifact output which will eat through disk space. Ideally I would like to configure just that build to keep a maximum of the last 3 successful builds but I don't want this limit applied to all projects.

Upvotes: 26

Views: 11881

Answers (1)

vcsjones
vcsjones

Reputation: 141598

Go to:

  1. Administration
  2. Build History Clean-up (right menu)
  3. At the bottom select your project / build under "Manage cleanup rules for"
  4. Click "Edit"
  5. In the popup, select "Custom" for "Clean artifacts"
  6. Put "3" in "Older than the -th successful build"
  7. Save.

This is as close to what you want. The only devation being that it will only discard artifacts after the nth successful build.

Or, another option presented in the settings is cleanup based on a date, like "Only keep the past 7 days".


Update for TeamCity 9.x and above:

  1. Administration
  2. Click the Edit link for any of your branches or <root project>*
  3. Clean-up rules on left hand menu
  4. Under What to clean-up choose the Edit link.
  5. Under the Artifacts section, put a value in the box: Older than the []-th successful build.

*Please note that TeamCity uses inheritance so if you edit the <root project>, all your projects will be affected. This is also the case if you set options for project groups.


Update for TeamCity 2019

  1. Find the builds of the project you want to change.
  2. Select Edit Build Configuration in the top right.
  3. Find the project inheritance hierarchy breadcrumb in the top left.
    • It will look similar to: Administration / <Root project> / YourParentProject
  4. Click on the project that is the direct parent to the project you want to edit. (YourParentProject in the example above.)
  5. Click on Clean-up Rules from the menu on the left.
  6. Find you project in the list shown in the main window and click the edit button found at the end of the project's row.
  7. Select retention rules as desired.

Upvotes: 47

Related Questions