Keep artifacts from only unique failed builds?

Having an issue just now running out of space on our artifact server every so often, most of the time there's plenty of space but when there's a string of failed builds Team City will keep all of their artifacts and it quickly uses up all available space. I want to keep artifacts for the previous X successful builds, but also want to keep artifacts for failed builds to investigate however I have no use for artifacts beyond the first unique fail of a build. Is there any way to configure the clean up rules to only keep artifacts for unique fails?


It is possible to configure cleanup to keep only artifacts from failed builds by adding a Keep Rule to your build configuration or project. Under the Build Filter section, you can choose Only Failed. Then, you can set the Range to only the last 1 build.



Eric Borchardt Yeah that's somewhat close to what I want to do, the issue is that I also want to keep the last X successful build's artifacts as well as only keeping one failed artifact (to avoid the build a constantly failing build from producing too many artifacts)

For example, I can set a build to keep the last 5 successful artifacts however if the build fails it will ignore this rule and keep an unlimited amount of artifacts until the artifact server is full


Glaceydev Have you tried adding two keep rules? One for successful builds and another for failed builds?


Please sign in to leave a comment.