开发者

How to make build definition in TFS Build 2010 configurable w.r.t input variable values and "items to build"

开发者 https://www.devze.com 2023-01-13 18:11 出处:网络
We are using TFS Build 2010 for Builds. We 开发者_开发问答have two branches of source code (Lets say branchA and branchB).

We are using TFS Build 2010 for Builds. We 开发者_开发问答have two branches of source code (Lets say branchA and branchB).

Now as a part of the build definition we set the projects to build:

How to make build definition in TFS Build 2010 configurable w.r.t input variable values and "items to build"

Now to employ the same build definition from branchB will mean that I create another build definition file with same content, with only the items to build set to "$/branchB"

Is there anyway to make this configurable, without having to edit the build definition?

Also there are other input variables that we set for the build definition, and the values for these variables are included in the build definition XAML file. So to change the value of a variable will mean that we have to edit the build definition XAML file. This is not desirable.

I would like to be able to set the "Items to Build" and the variables of the build definition without having to modify the build definition XAML file.

Are there any solutions to these problems?


You can modify the Build Process Template so it only asks you for the Items to Build. The rest of the arguments are prefilled. To get an idea how this works, see http://www.ewaldhofman.nl/?tag=/build+2010+customization


You can add parameters to your build definition. I did this a while back because we had two web projects in a solution that had to be deployed to different servers (via Windows shares). I added parameters to the build def so that in the build properties I could customize them depending on if it was a dev deployment, staging, etc.

I added a blog post on how to do it. You can use the parameters this way so that they aren't kept in the XAML file.

Deploying Web Apps with a customized Build Process in TFS

0

精彩评论

暂无评论...
验证码 换一张
取 消