Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I just want to find out the best practice to deploy your MVC3 application and what tool you use to get the job done.

I am using Visual Studio 2010. I publish my web site, then manually backup whats on the production server, then upload the new one there. It's tedious and error prone.

What should I do to make this job easier?

share|improve this question
    
This is a great question, I hoped that the answers would be a bit more fleshed out and numerous. –  Serg Oct 16 '12 at 22:16

5 Answers 5

up vote 4 down vote accepted

You may want to try TeamCity or any other Continous Integration Tool. We use TC and it's really painless the deployment process since it takes whatever you have on your Source Control Server (SVN in our case). TC isn't free but I think there are some other tools that do are

share|improve this answer
2  
Note that TC is free for limited use. –  John Nolan Jun 29 '12 at 16:02
2  
Jenkins is an excellent, completely free, CI server. See jenkins-ci.org –  Chris Simmons Jun 29 '12 at 17:47
1  
Is it really a good idea to automatically push potentially unstable code to production? I see this idea recommended often and I could certainly see it for a development/staging server, but for a live one? Even with tests in place there's a chance something might be different across servers. –  Wayne M Jun 29 '12 at 18:44
    
Also, TC is for all intents and purposes free. There's some minor limitations (the number of servers you can have it use) but for 95% of us I'm sure we only use a single server anyways. –  Wayne M Jun 29 '12 at 18:54

Visual Studio and IIS supports MS-DEPLOY. You can read more about it here: http://learn.iis.net/page.aspx/1080/testing-web-deploy-publishing-from-visual-studio-2010-and-webmatrix/

But basically you can have different profiles for your project and different "versions" of web.config where you can transform things like connection strings, application settings, etc. to the appropriate environment automatically before it gets published.

share|improve this answer

Visual Studio has nice publishing tools that will take care of the web.config transforms for you while publishing. I found it to be quite effective as long as you have access to the web server from your desktop.

share|improve this answer

I pretty much always use VS publish to a local directory and upload via FTP, if I'm using embedded databases I don't transfer over App_Data.

I guess it isn't the best way, but I've found it to work quite well. I also use SVN for version control so I don't really need to back up much on the production server.

share|improve this answer

For our production websites we install OctoPack (Octopus Deploy) into the web solution via a nuget package in Visual Studio 2013. We set up a Team City build configuration for that project to trigger a deployment with Octopus Deploy, in which we have set up a project and several machines and environments (e.g. staging, live). We use config transforms to ensure the correct config values are used for these environments.

Initially we used the free limited configurations for both Octopus and Team City but we have now switched to a paid license to enable multiple sites.

The Team City build occurs for us upon a check-in to the Staging branch in our Bitbucket git repository, which is approved via code review from a Tech QA via a pull request. This then triggers an automated deployment to the Staging environment.

We then promote the signed-off Staging release to the live environment through Octopus, which deploys the same package to the required environment. You can set up config values in Octopus for different environments and variable to use in config settings. In future we will using Feature Promotion instead of Environment Promotion for our support sites so that we can deploy Feature Branches from Staging to Live.

Once you've installed the Tentacles, Octopus is very straight-forward to use and I've had no real problems with Team City besides missing DLLs due to badly organised solutions. However, for my local environments, I would just use the built-in Visual Studio publish or even a deployment to a free Azure website for my own dev environment - again an option in VS 2013.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.