Sunday, February 10, 2008 #

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).

posted @ Sunday, February 10, 2008 6:04 PM | Feedback (2)