0

I have implemented continous build using TFS windows workflow. In this I have created a custom activity that will help me creating custom template of folders.

Is there any way that I can monitor the status of the build, that is if the build fails due to some exception I want to set a flag in database table that i created to failed.

I want to handle this in C# TFS API only.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
user804401
  • 1,990
  • 9
  • 38
  • 71

2 Answers2

1

Yes, you would need to probably create a custom build activity to enter your record in the database. You would place this custom activity in the template at the very end of the Run on Agent Sequence and check the status of Microsoft.TeamFoundation.Build.Client.BuildStatus.Failed to know if the build failed or not

Alex
  • 12,749
  • 3
  • 31
  • 45
  • 1
    Either that or you could use the QueryBuilds method to check the outcome of the builds at regular intervals. http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.build.client.ibuildserver.querybuilds.aspx – jessehouwing Feb 04 '13 at 21:50
  • @user804401 Added that as an alternative answer for you to accept. – jessehouwing Feb 13 '13 at 10:09
1

You can use the QueryBuilds method from the IBuildServer service API to query all builds inside TFS. You can specify the Build Status as one of the filters, plus a date range when the number of builds in the database grows too large.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341