We've created a set of good old fashioned windows batch scripts which tie together the process of completely rebuilding test systems and their databases. This gives us confidence that when we eventually upgrade a live web system that all the pieces of the upgrade have been well tested. The scripts will take an ASP.NET website offline, upgrade it (code and database) and put it back online all in one script. They can be run with or without a continuous integration server.
You can find the files here: https://gist.github.com/3164291
To rebuild a local development system run rebuild.bat
, to rebuild a QA system run rebuild-QA.bat
which overrides some of the values in the main rebuild file.
Some more details:
- The scripts must be run in a "Visual Studio Command Prompt" for the code build & deployment to work.
- The program relies on SqlHawk to do the database upgrade which must be available on the path.
- You can set environment variables at the command prompt to alter settings without altering the script files.
- Build and deploy of the code depends on visual studio due to the publish & web config transform parts.
The scripts will reset to a snapshot or backup of live before applying changes, meaning you can alter any part of your scripted update and retest all the changes.