Cleaning up Past Builds in TFS

Decided to a bit of spring cleaning on the TFS Continuous Integration box, deleted the code, deleted unused/unwanted drops and defragged the drive. Noticed we have had over 3000 builds in the past 13 months. Which alas was making the Visual Studio view of past builds a bit sluggish. Lamented over the lack of Visual Studio support to manage/delete these builds, and realised that this was going to take a lot of command line calls. Being lazy I looked to the internet but could not find anything that matched my criteria; rolled up my sleeves and knocked out a script similar to the following,

use tfsbuild

select 'tfsbuild delete http://mytfsserver:8080 MYPROJECT '+ BuildNumber + ' /noprompt'
from builds where starttime < dateadd(day, -30, getutcdate())

Ran this on the TFS database, copied the output to a command file and executed it. Job done, well will be when it finishes, which I estimate to be sometime tomorrow morning.

Yes I know it culd have been more elgant and I could have developed a fancy tool but I had a rugby match to watch; in hindsight my time would have been better spent developing the said tool (we won but it was not IMO convincing).

Print | posted on Sunday, February 10, 2008 6:04 PM

Comments on this post

# re: Cleaning up Past Builds in TFS

Requesting Gravatar...
Have you seen teh TFS Build Manager?
http://www.codeplex.com/TFSBuildManager
Left by AAron on Feb 10, 2008 7:33 PM

# re: Cleaning up Past Builds in TFS @AAron

Requesting Gravatar...
I have now - thanks - nice tool and does exactly what I wanted - I'll definitely be adding this to my list of tools.
Left by swilde on Feb 11, 2008 9:01 AM

Your comment:

 (will show your gravatar)