4

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?

1
  • This is a great question, I hoped that the answers would be a bit more fleshed out and numerous.
    – sergserg
    Commented Oct 16, 2012 at 22:16

5 Answers 5

4

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

4
  • 2
    Note that TC is free for limited use. Commented Jun 29, 2012 at 16:02
  • 2
    Jenkins is an excellent, completely free, CI server. See jenkins-ci.org Commented Jun 29, 2012 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. Commented Jun 29, 2012 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. Commented Jun 29, 2012 at 18:54
4

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.

0

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.

0

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.

0

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.

2
  • How does feature promotion work with Octopus ? Have you moved to that workflow since then ?
    – SzilardD
    Commented Aug 18, 2015 at 10:56
  • @SzilardD we use Releases to different envrionments in Octopus to promote one branch (dev) that has been merged into via Pull Requests through the environments. We haven't yet setup true Feature Promotion - but I'd like to, this would enable us to push and test multiple streams of work without affecting each other. There is a great walk through here octopus.com/blog/…
    – ladygargar
    Commented Sep 17, 2016 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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