在Visual Studio Team Services上构建特定分支 [英] Building specific branches on Visual Studio Team Services

查看:74
本文介绍了在Visual Studio Team Services上构建特定分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS Team Services中有一个存储库,该存储库设置为:

I have a repository in VS Team Services which is setup as :

-root
 |
 | -Dev (.sln)
 |
 | -Releases
     |
     | - Test (.sln)
     | - Live (.sln)

每个构建都可以正常工作,但是它可以拉整个仓库,我只希望它拉一个特定的分支(Dev,Test或Live)

Each build is working fine, however its pulling the entire repo and I just want it to pull a specific branch (Dev, Test or Live)

所以我要在dev分支中选择Solution.sln文件...

So I'm selecting the Solution.sln file in the dev branch...

推荐答案

在存储库"选项卡上,您可以指定工作空间映射,默认映射将获取整个存储库(不包括$/project/drops文件夹).

On the Repository tab you can specify your workspace mappings, the default mapping grabs your whole repository excluding the $/project/drops folder.

通过将第一个映射更改为不采用$/Project,但是$/project/dev,您将限制get操作的范围.如果您不再获得团队项目的根,则可以删除放置文件夹的隐身衣,否则只会发出警告:

By changing the first mapping to not take $/Project, but $/project/dev you'll limit the scope of the get operation. If you no longer get the root of your team project, you can remove the cloak of the drop folder, that will only raise a warning otherwise:

接下来要做的是,如果将此构建设置为CI构建,则它会在"Tiggers"选项卡上指定将触发此构建的文件夹,因为默认情况下,CI构建也会在以下时间触发整个团队项目中的任何变更.

The next thing you should do, if you're setting this build up to be a CI build, it to specify the folders that will trigger this build on the Tiggers tab, because, again by default, CI builds will trigger on any change in the whole team project.

为了让您将构建定义保留为模板,我建议使用$(Build.SourcesDirectory)\MySolution.sln而不是$/project/dev/Mysolution.sln,这样,您只需要在将构建定义克隆到另一个分支根目录或之后更新构建定义的映射即可.将其另存为模板时.

To allow you to keep your build definition as a template, I suggest to use the $(Build.SourcesDirectory)\MySolution.sln instead of $/project/dev/Mysolution.sln, that way you only need to update the mappings of a build definition after cloning it to another branch root or when saving it as a template.

这篇关于在Visual Studio Team Services上构建特定分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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