Automate Deployment for Web Applications?

24,716

Solution 1

Thank you all for your kind suggestions. We checked them all out, but after careful consideration we decided to roll our own with a combination of CruiseControl, NAnt, MSBuild and MSDeploy.

This article has some great information: Integrating MSBuild with CruiseControl.NET

Here's roughly how our solution works:

  • Developers build the 'debug' version of the app and run unit tests, then check in to SVN.
  • CruiseControl sees the updates and calls our build script...
    • Runs any new migrations on the build database
    • Replaces the config files with the build server config
    • Builds the 'debug' configuration of the app
    • Runs all unit and integration tests
    • Builds the 'deploy' configuration of the app
      • Versions the DLLs with the current major/minor version and SVN revision, e.g. 1.2.0.423
      • Moves this new build to a 'release' folder on our build server
      • Removes unneeded files
    • Updates IIS on the build server if required

Then when we have verified everything is ready to go up to live/staging we run another script to:

  • Run migrations on live/staging server
  • MSDeploy: archive current live/staging site
  • MSDeploy: sync site from build to live/staging

It wasn't pretty getting to this stage, but it's mostly working like a charm now :D

I'm going to try and keep this answer updated as we make changes to our process, as there seem to be several similar questions on SA now.

Solution 2

I use Puppet, Makefiles to build RPMs and Bamboo to do this for me. My system doesn't directly apply, and I'm not to familiar with the Windows world, but there are some transferable patterns.

My make setup allows me to build RPM's for everything (php libs, php websites, perl modules, C apps, etc) that make up my app. This can be called manually, or through Bamboo. I transfer these RPM's into a yum repo and puppet handles making sure the latest (or correct) versions of software are installed in the cluster.

Could you automate building software packages into MSI's? I think Puppet can manage installation of software packages and versions in Windows.

Solution 3

I have used Visual Build Pro for years, It's quite slick and easy to use and has many standard operations (like the ones you mentioned) built in.

Solution 4

I use msdeploy for this. It works perfect.

About Ant; for the .NET platform we have NAnt and you can use it in combination with MSDeploy; you have the possibility to call MSDeploy from your Nant-script.

Edited: Just to make things clear; you can do everything with msdeploy. Using Nant is not a requirement.

Solution 5

No one mentioned Final Builder http://www.finalbuilder.com. Its on par with Visual build Pro. Good GUI for creating automated build deployment harnesses

Share:
24,716
Sam Wessel
Author by

Sam Wessel

Technical Manager at Esendex Ltd

Updated on June 06, 2020

Comments

  • Sam Wessel
    Sam Wessel about 4 years

    My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually.

    We require a solution that will enable us to:

    - Compile the application  
      - Version the application with the SVN version number
      - Backup the existing site
      - Deploy to a web farm
    

    All our apps are source controlled using SVN and our .Net apps use CruiseControl. We have been trying to use MSBuild and NAnt deployment scripts with limited success. We have also used Capistrano in the past, but wish to avoid using Ruby if possible.

    Are there any other deployment tools out there that would help us?

  • Craig Tyler
    Craig Tyler almost 16 years
    What are your migrations written in? Straight SQL? Also how do you handle configuration files?
  • Sam Wessel
    Sam Wessel almost 16 years
    We currently use Ruby migrations. The build script calls rake and everything is taken care of. However, we're moving all our practices into alt.net, so it's likely we'll be changing this soon. As for config files, Cruise Control replaces the dev config with its own build config before compiling
  • rie819
    rie819 about 15 years
    I'm assuming that when you version the DLL's your checking in/out your AssemblyInfo files. How do you configure CruiseControl to ignore the SVC checkin of AssemblyInfo files? I'm looking at a similar solution and I'm worried that this would cause an infinite build loop.
  • Rob
    Rob about 14 years
    You can also use MSBuild which is what Microsoft wants you to use instead of NAnt. With the various contrib task libraries it's quite nice.
  • S P
    S P about 14 years
    I'm not using Nant either, but it was just meant as a suggestion in case really wants to keep using Nant!
  • BozoJoe
    BozoJoe almost 14 years
    Are you suggesting this as a build automation tool? I get that SSH is great for secure transmissions, but how does this make deployment easier?
  • BozoJoe
    BozoJoe almost 14 years
    big thumbs up for Kinook's Visual Build Pro
  • Aditya Sinha
    Aditya Sinha over 13 years
    Puppet for Windows is something I am investigating. MSI files for Windows is more trouble than it's worth I think. MsDeploy contains the semantics for deploying to IIS servers (with knowledge about app pools, acls and web sites/web applications), so to map msdeploy invocations into puppet's state-query language would imho be the most elegant solution.
  • davidtbernal
    davidtbernal about 13 years
    I know this is an old post, but any chance you've written anything about this? Your setup sounds like what I'd like to get to, but I'm new to the MS world, and I'm not really sure how to get there.
  • Sam Wessel
    Sam Wessel about 13 years
    Jim, I haven't and in fact I'm not even at the same company any more. It's a great idea though, I would like to write about it. It's worth taking a look at continuous integration solutions like Jenkins/CruiseControl/TeamCity as they take a lot of the pain out of automating the sort of process you're after.