WHAT'S NEW?
Loading...

TeamCity how to clean up old artifacts

Index



  • Intro
  • Problem!
  • Solution


Intro

I've been playing for a while with TeamCity (JetBrains). It is a great tool to manage your builds and put in place continuous integration in your team. But that's not the best part, because the guys from JetBrains don't charge you anything for the professional license which includes all of this:

  • Professional Server License
    • 20 build configurations
    • full access to all product features
    • support via forum and issue tracker
    • 3 build agents included, buy more as necessary


Problem!

It works so good, that you probably forget that it's there. It only happened to me when the disk of the server was getting full. This is produced by the artifacts. The artifacts are the nuget packages we create in our application. They live in our code repository and TeamCity uses them to know what are the results we need to ship.

If you didn't set up a proper cleaning process in your TeamCity box I will show you how.

Solution

First of all we need to login on our instance of TeamCity and the list of projects will be displayed. Select one of the projects and it will take us to another windows where we need to click on the option called: "Edit Project Settings"

On the left menu, click on the option "Clean-up rules". We'll be prompted to a view with our projects, the templates used on those projects and a third column with the clean up setup. Click on "Edit".


In the following window we just need to click on "Custom policy" within the "Clean everything including artifacts, history and statistical data". Then, define the amount of days or the number of successful builds we want to keep as displayed here below:


Finally, we can schedule this task on a daily basis and test it in live as displayed in the following picture within the Administration menu in TeamCity:



That's all, I hope you enjoy the lessons and I'm looking forward to hear your comments.

0 comments:

Post a Comment