If you seriously care about being Agile, then there are number of things that you need to take care of in your project. One of the few things that can add true agility to the agile practices that you claim to do is automation. AUTOMATE EVERYTHING YOU CAN!
In my current project we have successfully automated our application deployment process. To us, deploying the ‘latest’ or an ‘already compiled revision’ of the build to a desired environment (integration/qa/uat/prod etc) is a matter of a click. This encourages the team to deploy quickly, frequently and fearlessly.
This post will have us take a look at how to automate your application deployment using Microsoft Team Foundation Server (TFS). I am assuming that you are familiar with TFS and Team builds. Needless to say that you should have a Build Server (Build Controller, Agents) up and running. Assuming that you have the Build Controller and Agents in place, the first thing we will need to do is setup a basic CI build on the Build Server. Make sure to select Continuous Integration as the build trigger.
The CI build definition we just created will compile the build, run tests, deploy database (if configured) and drop the build to the specified location. But what we want to do here is tweak this build definition in a manner that it will do all of these and then go ahead and also deploy the application on the web server. Here is how we do it,
- Right click on the CI build-definition in team explorer.
- Select “Process”
- Expand “Advance” node, if not already expanded
- In the ‘MSBuild Arguments’, provide the following parameters,
|
And, there you go! Simple yet powerful. Try it out in your projects, you would be amazed with the results.
Whenever you talk about agile and build automation, you really can not complete it without a mention of Continuous Deployment/Delivery. These techniques are really about taking your agile practices to the extremes, both in terms of potential and performance. But, even if you don’t intend to get there immediately, it would still be unthinkable as to why wouldn’t you start automating things that you need to be doing as often as needed and as accurate as possible – build deployment is definitely one of them.