coder_bro
coder_bro

Reputation: 10773

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

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: alt text

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?

Upvotes: 2

Views: 3416

Answers (2)

DarylChymko
DarylChymko

Reputation: 1078

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

Upvotes: 0

Ewald Hofman
Ewald Hofman

Reputation: 12668

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

Upvotes: 1

Related Questions