views:

378

answers:

2

When you are using Team Foundation Build to build a project for multiple environments, do you do one build for all environments, or keep a separate build script for each environment?

Think of the case when I might want the workspace version on my build server to build in DEBUG mode for QA and RELEASE mode for UAT. Should one build request do both of those builds, or should I do a build for QA when I need a QA build, and do a build for UAT (using a label) when I need a UAT build?

One caveat might be that we might want the build to be automatically copied to the server for one environment and not the other. Perhaps we want the bits to go out to QA and not UAT, or we want the bits to go to UAT and not QA.

Let me know if you need further clarification.
Mark

+3  A: 

Will you always or almost always want to build both a QA and UAT release at the same time? If so, it makes sense to build them in the same project. If not, I'd separate them.

There may be other things you want to take into consideration (additional tasks in targets that may be specific to one build or another), but if you do choose to build them both, it's pretty easy to set up in your build project. Just add a second ConfigurationToBuild section.

<ConfigurationToBuild Include="Debug|Any CPU">
    <FlavorToBuild>Debug</FlavorToBuild>
    <PlatformToBuild>Any CPU</PlatformToBuild>
</ConfigurationToBuild>
<ConfigurationToBuild Include="Release|Any CPU">
    <FlavorToBuild>Release</FlavorToBuild>
    <PlatformToBuild>Any CPU</PlatformToBuild>
</ConfigurationToBuild>
ryan.rousseau
A: 

I did this for a Release and a Training Build but only get the Release folder created and populated for _PublishedWebsites. The Solution and Project Files support 5 different Builds for 5 different environments. The TFS Build completes successfully with only the Release folder populated.