Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team City Artifact Limit

Tags:

build

teamcity

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.

like image 304
Michael Edwards Avatar asked Jan 25 '12 17:01

Michael Edwards


People also ask

Where are artifacts stored in TeamCity?

By default, the artifacts are stored under the <TeamCity Data Directory\>/system/artifacts directory which can be changed. You can configure an external artifacts storage to replace the built-in one. Build artifacts can also be uploaded to the server while the build is still running.

What is artifact path in TeamCity?

Artifact Paths Build artifacts are files produced by the build which are stored on TeamCity server and can be downloaded from the TeamCity UI or used as artifact dependencies by other builds.


1 Answers

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.
like image 80
vcsjones Avatar answered Sep 28 '22 08:09

vcsjones