Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying application updates to multiple sites

I have an application consisting of an ASP.NET web application, a couple of Windows services, and a SQL Server 2005 database. This application is replicated at several sites, so that each site has a server containing all parts (web app, services, & DB). Currently the process for deploying updates is this:

Database

  1. Script database changes (using Generate Scripts in Management Studio).
  2. Connect to a site's DB in Management Studio.
  3. Run SQL script on site's DB.
  4. Repeat 2 & 3 for each site.

Web Application

  1. Use Publish in Visual Studio.
  2. Delete web.config from published copy.
  3. Zip web application files.
  4. Copy zip file to a site.
  5. Remote desktop into that site to unzip files.
  6. Manually modify web.config when necessary.
  7. Repeat 4-6 for each site.

Windows Services

  1. Build project in Visual Studio.
  2. Zip rebuilt binaries.
  3. Copy zip file to a site.
  4. Remote desktop into that site.
  5. Stop the service.
  6. Uninstall the old version.
  7. Install the new version.
  8. Manually modify the .config when necessary.
  9. Start the service.
  10. Repeat 3-9 for each site.

Currently there are 3 sites and deployments are annoying but manageable, however within the year we will most likely have 10 or 11 sites and having to deploy updates this way would make me suicidal.

So, I am looking for suggestions on how to automate this process. I have started looking into learning MSBuild for merging configurations and copying files out to my servers, but I'm not sure how far it will take me. Thanks.

like image 238
Misko Avatar asked Mar 26 '09 22:03

Misko


1 Answers

Take any script language you are comfortable with (looks like even .bat would work for you) and get PsTools

You can then use psexec and psservice to control processes and services remotely. You'll still have to write the scripts yourself but you won't have to login remotely (eg. to unzip and copy the files) and what works for one server will work for 10.

like image 54
laktak Avatar answered Sep 22 '22 20:09

laktak