views:

189

answers:

3

How do you deploy ASP.NET applications? Do you push it to production servers using UNC paths/mapped drives? FTP? SFTP? SSH/SCP (via 3rd party app installed)? Something else? Or do you pull it from the production servers with a Source control update or other mechanism? Consider the production servers being on the internet or in a DMZ, push requires opening insecure firewall ports (for UNC or FTP) does it not?

I'm trying to solidify my deployment philosophy for ASP.NET. The pieces that my ideal one-click build/deploy process will include are: MSBuild, Web Deployment Projects, CruiseControl.NET. But, I still struggle with how to actually deliver the bits to the production server.

After spending time on both Windows and *nix platforms, I get frustrated with the Windows deployment story and so am curious how others are doing this.

+2  A: 

I use cruisecontrol.net and am very happy with it. I have a nant script that cruise control calls which:

  1. Gets the source from our staging SVN branch
  2. Builds it
  3. Copies the files to each production server
  4. Creates a tag in our production branch in svn so we have a snapshot of what was pushed.

Works great! We used to do this all manually a year ago and I can't tell you how much better this is. There is a small learning curve and some upfront script writing. That might take a couple days but you will save much more time in the end.

Matt Wrock
This is a great approach and the one I'm looking at, but I'm specifically interested in what you did in step 3 to securely deliver the files?
RyanW
Well, its all happening inside our firewall. If you are doing this from the outside, I would bet you could script sftp or scp.
Matt Wrock
Exactly, I'm hoping for practical experiences with sftp or scp (since Windows server doesn't support these very well).
RyanW
+1  A: 

This is how we publish:

  • Publish from Visual Studio to a local folder
  • Remove some unwanted files and folders (like the empty web reference folder that it creates for no appearent reason...)
  • Zip
  • Use remote desktop to copy to stage server
  • Unpack in a temp folder in the site (this gives the files the right permissions)
  • Move current files to a backup folder
  • Move new files to site
  • Test that it works on the staging server
  • Run a script (set up by the hosting company) that copies files to the two front end servers

(However, we had some hardware problems with one of the front end servers, so as a short term (?) solution we got to borrow another server as font end server, and the script doesn't copy the files to that server. So the last year or so I have had to use remote desktop to log on to the live server, manually copy the files, move current files to a backup folder and move new files in place.)

Guffa
Thanks for sharing. Interesting to see Remote Desktop being used to copy files. I'm hoping to automate it a little more, but will definitely remember that for one-off needs when the automation needs help or breaks down.
RyanW
A: 

plz check this thread..

http://stackoverflow.com/questions/974799/what-method-do-you-use-to-deploy-asp-net-applications-to-the-wild/974876#974876

Muhammad Akhtar
Thanks, some good ideas in that thread.
RyanW