Team City Artifact Limit

Michael Edwards picture Michael Edwards · Jan 25, 2012 · Viewed 9.3k times · Source

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.

Answer

vcsjones picture vcsjones · Jan 25, 2012

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.