Handling Deployment to Multiple Environments

Posted by JayGee on Programmers See other posts from Programmers or by JayGee
Published on 2013-08-02T00:16:57Z Indexed on 2013/08/02 16:03 UTC
Read the original article Hit count: 310

Filed under:
|

How should I handle deploying web applications to multiple servers?

Constraints

I have a dev, test and prod environment. No build server is available. Developers can't deploy to prod. The people that do deploy to prod copy files from test to prod. They don't have VS installed.

Currently

The way it's handled is using web.config transform. However, to deploy to prod involves putting prod code on the test server where it's copied over.

Problem

Sometimes simple mistakes are made, such as forgetting to change test back to the right environment after deployment. Or the test config gets moved to prod instead of the prod config.

Solution

So the question is, what is the best way to prevent mistakes from happening?

My first thought is let the app determine which server it's on at runtime and use the appropriate settings/connection strings/etc... However, the server names could change in the not too distant future. So if multiple apps are hard coded, that would mean updating all of them. The easiest way to handle that situation would be to place a DLL in the GAC that determines the environment.

Are there any drawbacks or possible complications that this would cause? Or is there a better solution to the problem than this?

© Programmers or respective owner

Related posts about ASP.NET

Related posts about deployment