How to cleanup old Failed Builds in TeamCity?

久未见 提交于 2019-12-09 07:24:06

问题


We do have hundreds of failed builds in TeamCity (number is especially high because of old retry on fail settings) and now it's a pain to browse history.

I want to clean up only old failed builds, is there anyway to do that in TeamCity? Normal clean-up policy only allows X days before the last successful build sort of clean ups.


回答1:


I tried to find a "delete build history record" but I couldn't find one. That doesn't prove it isn't there, but it it was, it would be an opportunity for devs to abuse it as some PM's use the history as a metric that may say something about code quality. If we could delete all the failed builds, it would make this statistic game-able.

Of course there is the policy page which has some tuning, but not the sort you mentioned (you can't remove just failed builds) admin/cleanupPolicies.html

You might want to pin your favorite builds (which should protect them from clean up) and then change the policy to clean up everything 1 day old, then change the policy back to something more reasonable.




回答2:


In more recent versions of TeamCity you can now:

  1. Click on the build you want to remove.
  2. From the Build Actions menu select Remove...
  3. Put in an optional comment and click the Remove button to remove that build.



回答3:


There is a way to delete a build and it is using REST protocol: http://confluence.jetbrains.net/display/TW/REST+API+Plugin

Get details of a specific build:
GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>
(also supports DELETE to delete a build)

To run this you need a REST client. I've used a plugin for Firefox, which is quite nice. But any REST client should do the work. It makes sense first trying on the test TeamCity instance, as you won't have a chance to recover deleted build, except from backup.

Update

New version of TeamCity (since 8?) supports deleting builds naturally. Hey-hey!! ))

Just go to the build page, then Actions > Remove ...



来源:https://stackoverflow.com/questions/2947910/how-to-cleanup-old-failed-builds-in-teamcity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!