Artifact Clean-up Rules with Dependencies

We're having issues getting the clean-up rules to behave as we expect for removing artifacts from builds with dependencies. I've read through all the forum posts and issues I could find related to this and didn't find an answer. I'm going to describe our scenario and what we're trying to achieve.

Builds A and B have no dependencies and publish artifacts. Build C has snapshot dependencies on builds A and B and publishes artifacts. Build D has a snapshot dependency on build C, artifact dependencies on builds A, B, and C, and publishes artifacts. Build E has snapshot and artifact dependencies on build D and doesn't publish artifacts. All of these builds are run at least once daily, usually far more often.

All builds have the following clean-up rules:
Everything more than 90 days older than the last build
History more than 60 days older than the last build
Artifacts more than 5 days older than the last build; artifact patterns: +:**/* +:.teamcity/.NETCoverage
Do not prevent dependency artifacts cleanup

We expect these rules to remove artifacts from all builds more than 5 days old while keeping history for 60 days.

Instead, artifacts of all the dependencies are being kept until the final build (Build E) is deleted. This is leading to server space issues as some of the artifacts are fairly large. Is this the expected behavior for our rules? If yes, is it possible to set up rules which will do what we want (delete artifacts after 5 days, delete history after 60)?

0
2 comments
Avatar
Permanently deleted user

Hi,

I had a similar problems, I could not get my clean up rules to work.

I solved my problems with this, go to your build and go to build features, add build file cleaner

Build Features

   
Build files cleaner (Swabra)Build files cleanup before build enabled


This did the trick for me, i got rid of old artifacts
   

 



 

 

 

 

 

0

Hi both,

 

thanks for your help, Christoffer, but those should be separate problems. Build files cleanup works on the build agent, and removes files stored on the agent. The clean up policies are applied only server side.

 

Which version of TeamCity are you using, Andrew? Do all builds happen on the same branch? Or are they in separate branches? Branches are counted independently towards cleanup

0

Please sign in to leave a comment.