TFS构建,一个为多个分支构建的构建 [英] TFS build, one build for many branches

查看:182
本文介绍了TFS构建,一个为多个分支构建的构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用TFS源代码控制,并且有两个构建控制器(一个VS2010,另一个VS2012).我们使用默认的构建工作流程模板栏进行一些自定义更改.

We use TFS source control and have two build controllers (one VS2010 the other VS2012). We use the default build workflow template bar a few custom changes.

由于我们有许多分支,我们将如何根据所需分支来更改工作区?

As we have many branches, how would we go about changing the workspace based on the desired branch?

我正在考虑为分支($\oursourcecontrol\branches\main)添加一个参数,然后将其作为变量传递到工作流的get工作区部分.

I was thinking of adding a parameter for the branch ($\oursourcecontrol\branches\main) and then just passing it as a variable in to the get workspace part of the workflow.

还是有更好的方法呢?

推荐答案

您目前还不能,确实很遗憾.它将完全中断对CI和Gates签入的触发器支持.您可以使用 TFS社区构建管理器快速克隆和调整构建定义以支持多个分支.

You currently can't and it is really a shame. It would completely break the Trigger support for CI and Gates checkins. You can use the TFS Community Build Manager to quickly clone and adjust build definitions to support multiple branches though.

您可以做的是获取比您需要的更多的内容(例如$/Sourcecontrol/Branches/*),然后在任何路径参数上使用字符串替换(例如构建解决方案,测试设置文件等),将它们全部指向正确的位置解决方案.您可能需要做一些类似于{BRANCH}的模板,以便您可以轻松地替换这些标记.

What you could do, is to fetch more than you need (say $/Sourcecontrol/Branches/*) and then use a string-replace on any path parameter (like solutions to build, test settings file etc) to point them all to the correct solution. You'll probably need to do some templating like {BRANCH} so that you can easily replace these tokens.

Git构建模板确实在Git存储库上支持此功能,但是您需要TFS 2013才能利用服务器端Git支持.

The Git build template does support this on a Git repository, but you'd need TFS 2013 to make use of server side Git support.

这篇关于TFS构建,一个为多个分支构建的构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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