I deploy mostly ASP.NET apps to Linux servers. Here is my standard workflow:
- I use a source code repository (like Subversion)
- On the server, I have a bash script that does the following:
- Checks out the latest code
- Does a build (creates the DLLs)
- Filters the files down to the essentials (removes code files for example)
- Backs up the database
- Deploys the files to the web server in a directory named with the current date
- Updates the database if a new schema is included in the deployment
- Makes the new installation the default one so it will be served with the next hit
Checkout is done with the command-line version of Subversion and building is done with xbuild (msbuild work-alike from the Mono project). Most of the magic is done in ReleaseIt.
On my dev server I essentially have continuous integration but on the production side I actually SSH into the server and initiate the deployment manually by running the script. My script is cleverly called 'deploy' so that is what I type at the bash prompt. I am very creative. Not.
In production, I have to type 'deploy' twice: once to check-out, build, and deploy to a dated directory and once to make that directory the default instance. Since the directories are dated, I can revert to any previous deployment simply by typing 'deploy' from within the relevant directory.
Initial deployment takes a couple of minutes and reversion to a prior version takes a few seconds.
It has been a nice solution for me and relies only on the three command-line utilities (svn, xbuild, and releaseit), the DB client, SSH, and Bash.
I really need to update the copy of ReleaseIt on CodePlex sometime:
http://releaseit.codeplex.com/