Building specific branches on Visual Studio Team Services

故事扮演 提交于 2020-01-01 04:16:14

问题


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

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

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)

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


回答1:


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

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:

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.

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.



来源:https://stackoverflow.com/questions/34689987/building-specific-branches-on-visual-studio-team-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!