Search code examples
tfstfsbuildslowcheetah

Guiding a "build" through the development, build, and deploy process


Problem

Using TFS--specifically Team Build--I am trying to come up with a strategy for building and deploying several web applications. I'm struggling with defining how exactly I want to perform those builds and deployments.

In this case, I define builds as what one creates when one compiles any application. I define a deployment as what one actually releases to some environment, even if that environment is internal.

TFS provides one with a way to create a Build. The generated Build's quality may be set by appropriate users. A Build may have a quality of Ready for Testing, Passed in QA, Passed in UAT, Failed, Released, etc.

Possibilities

I have worked on projects that have build definitions set up in TFS that correspond to deployments. So, for example, a PC will have the Builds ReleaseQA, ReleaseUAT, and ReleaseProd. Although this definitely works and is integrated into TFS, it feels like cheating to me; rather than creating one build and shepherding it through one's environments, one is creating many builds and deploying each to a different environment.

I envision a process that works by generating a Build and then promoting that Build through the various environments.

Awesome

Right-click a particular completed build in TFS and pick Deploy->UAT.

Less Awesome

A folder of scripts sitting on my build machine with titles like deploy-build-qa, deploy-build-uat, and deploy-build-prod; one calls them with a build number and the script deploys that build to the appropriate environment

You

Is there a well integrated way to do something like the Awesome scenario I propose or am I stuck with something less awesome? If there isn't anything "out of the box", I am open to add-ons or applications.


Solution

  • Yes this is possible! I've been implementing it today for the infrastructure of a new project I'm working on :)

    I came to use TfsDeployer.

    First I crated a powershell script that uses MSDeploy (we're building a solution with multiple Web and WCF projects) and then link the scripts to TfsDeployer.

    Now I can change the quality of a build and kick of a powershell script that will deploy the build to a test, acceptance or production server.

    Something I also really liked for helping with all the config transformations is SlowCheetah. It helps with defining transformations for all xml files and the ability to simply preview the transformation.

    Hope this helps :)