views:

628

answers:

9

I've always deployed my web applications via FTP (sometimes even xcopy), and then manually run database scripts myself.

I started deploying this way in the 90's, but lately, I've seen a few web apps with installers. I'm starting to question, if I'm locked into an out dated process. I'm a consultant, my apps are usually internal, so I don't worry about distributing and having others installing them.

But I'm curious; does anybody create installers to deploy internal asp.net web applications?

If so, why? (Voluntarily, mandated, or part of an automation process)

And have you had any problems doing it this way?

+4  A: 

absolutely. We use it to do all of our apps. That way we create the installer and run it on the qa and uat environments to test and we know exactly what is going to happen in production. There are no guesses as to what order someone might do something in, or if they miss a step. It makes things a lot easier.

Ooh I forgot about the automated process too. We have systems in place (Ant Hill Pro) which automatically deploy it to the proper environments. The qa people don't have to wait for something to be done, because it's all done at 2 am. If they need to rerun the build with updates, the devs check the code in and we push a button, and it's automatically deployed. No waiting for the build engineer, because he's in a meeting or sick or whatever.

Kevin
That's a good point. I first deploy to our business validation server, then copy from the validation server to production. But this is definitely a valid reason to use an installer.
John MacIntyre
I never realized how much pain it was to do it manually until we started using installers. It is so much less of a headache to not have to worry about a human component of missing a file or something after it has all been tested.
Kevin
"not have to worry about a human component" this is something that bothers me as well. Can I ask you a question? Is your SQLScript embodied into your installer? Or is it seperate?
John MacIntyre
I don't think it is in an installer, but it is run through the system. The system compiles all of the scripts into one master script and then runs it agains the database. We make all the scripts "rerunnable" we check to see if the fields exist before adding etc, so we can run the script again.
Kevin
+3  A: 

You always want to have an automated way to build and deploy - it greatly reduces the chances of a one-off error if you forget a certain step. Also, it allows you to offload the deploy to someone else easily without having to teach them 100 customized steps. Whether the project is internal or not, all applications should follow best practices.

Tai Squared
"internal or not" Are you suggesting doing this even for a webhost? If so, how do you run it? Do you get the webhost to run it for you?
John MacIntyre
Do you not have access to your hosting machine? If not, it is even more important to have a build that handles all of the deployment steps so you can tell them just to run the install instead of copying these files, running this script, checking this box, etc...
Tai Squared
For most all of the internal apps I do. But I have 2 clients with apps on shared webhosting. And with these 2 clients, I definitely don't have access to run something like that ... at least I don't think I do ... I've always assumed I didn't.
John MacIntyre
+1  A: 

Personally I'm a bit like the OP; generally I just deploy using FTP, but in saying that typically my applications are internal, or in the case of other projects, 100% managed by me.

I've also been thinking about this lately however, and have started to think about how using proper deployment may improve the process - having to document a detailed install process can be a real pain.

CapBBeard
Yeah, the big problem with doing it this way, is the whole app is broke during the process, which can take a few minutes doing it manually, and watching every step.
John MacIntyre
+1  A: 

I use Powershell and found really easy to automate lots of tasks. You will probably find a bit different at the very begining but at the end you will see that it's all about the power of the .NET libraries !!!

afgallo
So you have a PowerShell script to automate the install for you? That's in interesting idea as well. thx
John MacIntyre
yep John so things I remember I do on those scripts are:1.Backup last build 2.Deletes unnecessary files3.Configure the web.config4.Get all .js files and minify them5.ZIP and FTPAfter that I run another script to actually install the web site on the desired server.
afgallo
+1  A: 

I have use the "Web Setup Project" to create an MSI that installed the output of a "Web Deployment Project" for an internal app. Our server admin wasn't up to the task to doing a 50 step manual install. For my current app, my server admin doesn't like the 'black box' feel of MSI installers and prefers getting a pile of files and a 50 step deployment manual. (See a pattern here? Ask your server admin what he wants.)

The Web Setup Project doesn't make it immediately obvious how to install to anything other than the "Default Website", other than that, it made the installation process repeatable and created a built in way to rollback (by just running the installer from 1 version ago).

This of course assumes that your virtual directory doesn't hold any user modified content-- I wouldn't trust an MSI to properly merge user created and new files.

MatthewMartin
"'black box' feel of MSI installers" I can definitely see that.
John MacIntyre
+1  A: 

We use the "XCopy" deploy model here, since the Ops folks have their own method of setting up security on a new web application on the server.

However, we did need to use an installer when we had to install a web application that was using a newer version of Crystal Reports since it had to do something special with a key and we didn't have a full blown version of CR on the server itself. So keep that in mind when working with third party apps, they may need to do some kind of merge module that the MSI handles easily.

Dillie-O
When you do the xcopy thing, do you just run the sql scripts seperately? Or do you have another process for that?
John MacIntyre
Yeah, should have added that two. Typically I inform the DBA that the app is ready, they do the DB migration, then I notify the Ops folks and then they do the creation of the IIS site and copy the files over.
Dillie-O
+1  A: 

Yep...we have an app that needs a lot of pre-requisites set up....web service, windows service, user accounts, security, folder creation, GAC bits etc....I rolled it all up into a nice MSI with custom actions that can install and uninstall cleanly. Saved about one hours worth of work to deploy on a new box.

A lot of the other smaller apps are just deployed by doing Publish Website to a local folder then ftp'ing the contents to the target.

Kev
+1  A: 

It greatly depends upon the scale of your project, your enviornment and your internal user base. I rarely deploy with an msi because we are too small an operation to have multiple environments (except for SharePoint, that's different all together) . We develop and use VS to deploy web apps to a development box, assuming they are approved then we use VS again to deploy to the live box.

The only proviso is that we have multiple copies of the web.config (appended with test, dev and live) and we then delete the suffix off the relevant file depending upon where its been deployed.

It's probably not the best methodology (I know it's not), but it works and it aids rapid deployment of small to medium sized solutions in a small-scale user environment.

Charlie
+1 Thanks for the answer, but I'd argue that you are never too small for a multi-environment setup. It isn't difficult or expensive to setup either, especially not with VMs.
John MacIntyre
That depends upon whether you are a resource who is stretched to capacity. Who is going to set these environments up? Maintain them? More to the point who is going to test the code on the test environment once its there? Its all too easy to make your argument. If you are in a position to have that set-up then sure it's better, of course it is! But I can't do it due to being over resourced and there isn't anybody else.
Charlie
A: 

F5ToDebug...

Your saying its OK to take short cuts if you dont have time to do it properly?

"who's going to test the code on the test environment?" You said it yourself that you have config files for _test - why would that not be a suitable test?

Pete