TFS 2010 扩展门控构建以将变更集 ID 发送到另一个系统

发布于 2024-12-28 06:17:10 字数 433 浏览 1 评论 0 原文

我正在扩展门控构建以与第三方系统集成。我最终想做的是将变更集 ID 和已更改文件列表发送到该系统。

遵循 Jim Lamb 的帖子 (http://blogs.msdn.com/b/jimlamba/archive/2009/11/18/how-to-create-a-custom-workflow-activity-for-tfs-build-2010。 aspx)我添加了一个活动来连接到其他系统,并在签入门控更改活动后将其添加到我的构建定义 xaml 中。

我的问题是,如何获取自定义活动中所需的有关此特定构建的信息?

I am extending a gated build to integrate with a 3rd party system. What I'd like to do ultimately is send the changeset id and list of changed files to this system.

Following Jim Lamb's post (http://blogs.msdn.com/b/jimlamb/archive/2009/11/18/how-to-create-a-custom-workflow-activity-for-tfs-build-2010.aspx) I've added an activity to connect to the other system and added it to my build definition xaml after the checkin gated changes activity.

My question is, how do I get the information about this specific build that I need in my custom activity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2025-01-04 06:17:10

从您的问题来看,您似乎想专门获取由门控构建签入的变更集列表,然后获取已更改文件的列表。

在 TFS 2010 中,CheckInGatedChanges 不会向您提供其提交签入的变更集列表,因此您需要依赖签入发生时创建的构建信息节点。

在自定义活动中,您可以从工作流中获取 IBuildDetail 对象,然后使用它来查询类型为 CheckinOutcome 的构建信息节点。您可以从此信息节点读取两个字段“ChangesetId”和“CheckInCommissed”。确保 CheckInCommited 等于“成功”。

要从工作流中获取 IBuildDetail 对象,您需要将 InArgument 属性添加到自定义活动中:

        public InArgument<IBuildDetail> Build { get; set; }

然后在代码活动中使用:

        IBuildDetail build = Build.Get(context);

如果要创建复合活动,则可以使用 GetBuildDetail 活动来获取 IBuildDetail 对象。

希望有帮助。

From your question, it seems like you want to specifically get the list of changesets that are checked in by the gated build, and from then get the list of changed files.

In TFS 2010, the CheckInGatedChanges does not give you the list of changesets it committed the check-ins, so you will need to rely on the build information nodes that were created when a checkin occurs.

From your custom activity, you can get the IBuildDetail object from the workflow, then use it to query for the build information nodes with type CheckinOutcome. You can read two fields "ChangesetId" and "CheckInCommitted" from this information node. Make sure CheckInCommitted is equal to "succeeded".

To get the IBuildDetail object from the workflow, you need to add an InArgument property to your custom activity:

        public InArgument<IBuildDetail> Build { get; set; }

Then in your code activity, use:

        IBuildDetail build = Build.Get(context);

If you are creating a composite activity, you can use GetBuildDetail activity to get the IBuildDetail object.

Hope it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文