问题
We are using TFS 2010 for source control and project management, and TeamCity 6.0 for performing builds and build reporting (CI and daily deployments for testers). Setting up TFS source labeling in TeamCity to match the build number was very straightforward, but I cannot find a way to link this back to TFS Build Explorer.
We want link these to be able to assign bugs to particular builds through TFS for the daily tester deployment builds.
回答1:
I don't know if you can, at least without some heavy VSX work or direct manipulation of the database, get the TeamCity builds to show up in the TFS Build Explorer.
However, the "Found in Build:" drop down on in the bug workitem is a populated by a global list which you can add to pro grammatically using http://blogs.microsoft.co.il/blogs/shair/archive/2010/03/08/tfs-api-part-23-create-global-list-xml-way.aspx .
回答2:
This isn't an awesome answer as I don't know Team City, but you may ask the Team City group if they have a TFS build process template that delegates to Team City. Final Builder has this in which TFS does the monitoring and scheduling of builds and some details, but Final Builder does the actual work. This gives you a mixed bag in my opinion, but it doesn't what you are intending.
回答3:
Concerning the Team Explorer :
Microsoft never open the customization of the Team Explorer by providing corresponding API in the Object Model. You're not supposed to add/modify/change nodes there. But people succeeded by doing some reflection tricks.
I still don't think it's a good idea to customize the Team Explorer, especially when you see Visual Studio 2012: they revamp everything there.
Microsoft Test Manager :
Looks like the data is pulled from the Team Build API directly, so you won't have the possibility to plug Team City there.
The Work Item field is a different story :
The values present are built from a Global List which is updated by Team Build. So you can maintain the list content instead of Team Build if you use Team City, Sean Lynch gave you the pointer to update a global list. This point is not hard at all, it's pretty straightforward.
All in all what you need the most if the Work Item field and you can do that. If you still need a list of all your Team City builds in Visual Studio, write a Visual Studio .vsix to add a custom View showing your Team City Build. I have less hope for MTM.
Last comment: stay away from the TFS Database, Microsoft is clear that you're not allowed to read/touch it. It's tempting, but you'll lose all MS support if you do it. But note it would be the only way to achieve what you want...
回答4:
Here is a blog post as a starting point to create an app that records in TFS the results from your TeamCity build. Then you could run your app as part of your TeamCity build.
http://blogs.msdn.com/b/jpricket/archive/2010/02/23/creating-fake-builds-in-tfs-build-2010.aspx
来源:https://stackoverflow.com/questions/4889410/how-do-i-make-a-teamcity-build-appear-in-the-tfs-build-explorer