TFS build, one build for many branches

前端 未结 2 1465
没有蜡笔的小新
没有蜡笔的小新 2021-02-15 15:39

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

相关标签:
2条回答
  • 2021-02-15 15:56

    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.

    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.

    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.

    0 讨论(0)
  • 2021-02-15 15:58

    I mapped the server path in the Repository tab at higher level that TFS branches are contained. Cloak rest of the branches not required for Get sources step except the branch to be built. And create variable to pass the branch name, check allow at queue time. Use this branch variable in build steps to make the build definition work for all the branches. You may need more than one variable based on your branches structure in TFS.

    0 讨论(0)
提交回复
热议问题