如何在代码中的用户检查后执行TFS服务器上的代码 [英] How to execute code on TFS server after a user checks in code

查看:431
本文介绍了如何在代码中的用户检查后执行TFS服务器上的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建设需要一个团队基础服务器上执行一些代码(2010+)服务器集成系统时,一些改变用户检查。我可以用图解的访问检查插件没有问题,但我想知道什么时候添加新的检查插件。理想情况下,我希望得到通知,并给出了数据校验,所以我可以操纵它,并张贴了什么,我需要一个不同的API,但如果注意到一个新的支票是所有存在,这将是足够的。理想情况下,我将能够有TFS执行在同一台机器上我自己的C#代码的调用。

I'm building an integration system that needs to execute some code on a Team Foundation Server (2010+) server when a user checks in some changes. I can diagrammatically access check ins no problem, but I would like to know when new check ins are added. Ideally, I would like to be notified and given the check in data so I can manipulate it and post off what I need to a different API, but if a notice that a new check in is all that exists, that would be sufficient. Ideally, I would be able to have tfs execute a call to my own C# code on the same machine.

我一直期待在互联网的最后2天,我坚定地相信,这是可能的,但是我似乎无法找到如何做到这一点的任何细节,坦白说我跑出来就在哪里看的想法。如果有人有从哪里开始的任何想法,或在哪里看,还是理想的任何类似的来源的想法,这将不胜感激。

I've been looking around the internet for the last 2 days, and I'm firmly confident that this is possible, however I can't seem to find any details on how to do it, and frankly I'm running out of ideas on where to look. If anybody has any ideas on where to start, or where to look, or ideally any similar source ideas, it would be greatly appreciated.

主要是,我已经挖围绕在TFS集成工具,但该文档仍然是值得商榷的最好的。我发现所有的现有的适配器的源代码(对于ClearCase等),但什么也没有看到任何地方触发执行,因为我怀疑那些更意味着一种方式迁移。

Mainly, I've been digging around in the TFS Integration Tools, but the docs for that are still questionable at best. I've found all of the existing adapter source code (for clearcase etc) but don't see anything to trigger execution anywhere, as I suspect those are more meant for one way migration.

推荐答案

有可以处理这个不同的方式:

There are different ways you can approach this:


  1. 团队建设。通过使用TFS构建服务器,您可以创建一个持续集成构建或门控签入打造。在构建工作流可以再回应你检测什么变化。您可以使用TFS客户端对象模型来获取变更集对象。这包含了你所需要的所有数据。该ALM流浪者写了广泛的指导讲解如何扩展和自定义生成过程,以满足您的需求。

  1. Team Build. By using a TFS Build Server you can create a Continuous Integration build or a Gated Checkin build. In the build workflow you can then respond to whatever changes you've detected. You can use the TFS Client Object Model to grab the Changeset object. That contains all the data you'll need. The ALM Rangers have written an extensive guide explaining how to extend and customize the build process to suit your needs.

签政策。通过创建自定义签入策略,您可以运行在客户端上的代码预签(在Visual Studio中)。 这一政策可以作为对如何与挂起的更改交互的样本。

Checkin Policy. By creating a custom checkin policy you can run code pre-checkin on the client (inside Visual Studio). This policy could serve as a sample on how to interact with the pending changes.

ISubscriber TFS应用层插件。通过@ppejovic已经提到。应用层的插件安装在TFS服务器上,将在进程中运行。由于它是在托管过程中,你可以做相当多的。上工作项和/或源代码控制法案样品href=\"http://mergeworkitems.codeplex.com/\">合并工作项目处理程序中,的 TFS聚合。这里描述也可以退回到如果需要,客户端对象模型,

ISubscriber TFS Application Tier plugin. Already mentioned by @ppejovic. The Application Tier plugin is installed on the TFS server and will run in process. Since it's hosted in process, you can do quite a bit. Samples that act on Work items and/or Source Control are the Merge Work Items handler, the TFS Aggregator. You can also fall back to the Client Object Model if needed, as described here.

的SOAP API。这是前体ISubscriber接口。您仍然可以使用它,但你必须从ISubscriber解决方案的更多动力和效率

The SOAP API. This is the precursor to the ISubscriber interface. You can still use it, but you'll have more power and efficiency from the ISubscriber solution.

Client~~MD~~aux对象模型。你总是可以创建一个服务或定期连接到TFS请求的历史,因为其检查的最后一次系统的计划作业。通过简单的存储查询比一切到目前为止,你可以得到你需要,而不必延长TFS系统自身的所有信息,你见过最高的变更数量较新。你会寻找 VersionControlServer 类。该 QueryHistory 方法是你需要获取一个变更集

The Client Object Model. You can always create a service or a scheduled job on a system that periodically connects to TFS to request the history since the last time it checked. By simply storing querying everything newer than the highest changeset number you've seen so far you can get all the information you need without having to extend TFS itself. You'll be looking for the VersionControlServer class. The QueryHistory method is the one you'll need to fetch the changesets.

有一个不错的Pluralsight课程,带你穿越的其中的一些场景的的。

There's a nice Pluralsight course that takes you through some of these scenario's.

与这些项目大部分,文档是稀缺的和工具,如红门反射.NET
或Jetbrains的dotPeek是非常宝贵的。

As with most of these items, documentation is scarce and tools like Red-Gate Reflector .NET or Jetbrains dotPeek are invaluable.

这篇关于如何在代码中的用户检查后执行TFS服务器上的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆