At work we currently use the following deployment strategy:
- Run a batch script to clear out all Temporary ASP.NET files
- Run a batch script that compiles every ASPX file into its own DLL (ASP.NET Web Site, not Web Application)
- Copy each individually changed file (ASPX and DLL) to the appropriate folder on the live server.
- Open up the
Deployment Scriptsfolder, run each SQL script (table modifications, stored procs, etc.) manually on the production database. - Say a prayer before going to sleep (joking on this one, maybe)
- Test first thing the next morning and hope for the best – fix bugs as they come up.
We have been bitten a few times in the past because someone will forget to run a script, or think they ran something but didn’t, or overwrote a sproc related to some module because there are two files (one in a Sprocs folder and one in a [ModuleName]Related folder) or copied the wrong DLL (since they can have the same names with like a random alphanumeric number generated by .NET).
This seems highly inefficient to me – a lot of manual things and very error prone. It can sometimes take 2-3 or more hours for a developer to perform a deployment (we do them late at night, like around midnight) due to all the manual steps and remembering what files need to be copied, where they need to be copied, what scripts need to be run, making sure scripts are run in the right order, etc.
There has got to be an easier way than taking two hours to copy and paste individual ASPX pages, DLLs, images, stylesheets and the like and run some 30+ SQL scripts manually. We use SVN as our source control system (mainly just for update/commit though, we don’t do branching) but have no unit tests or testing strategy. Is there some kind of tool that I can look into to help us make our deployments smoother?
I did not go through all of it, but the You’re deploying it wrong series from Troy Hunt might be a good place to look at.
Points discussed in the series :