This document discusses automating software deployments using tools like msbuild and msdeploy to enable continuous deployment and delivery. It outlines the pain points of manual deployments and goals of automating deployments. It provides guidance on setting up continuous integration, automated testing, packaging, and configuration for both new systems and existing environments. It also lists best practices like deploying early, having rollback plans, logging builds, and automating as much as possible.
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
Automated Deployment with msbuild and msdeploy
1. With msbuild and msdeploy Continuous Deployment Delivery -----------
2. Abstract If you are deploying your software manually, you are doing it wrong. If you deploying once a month, you are doing it wrong. If you as a developer are deploying from Visual Studio by clicking "Publish", you are doing it wrong. If a bug-fix takes you 1 hour but your customer needs to wait a week until he gets it, you are doing it wrong. Manual deployments are NOT fun. There is a nice way on how to automate the deployment with TFS 2010, msbuild and msdeploy.
5. Continous Deployment Deploy continously... After each change... To a certain env... Continous Delivery Be production ready... through dev cycle... release any time...
6. Peter Gfader Australia (my fun) Italy (my country) German (my language) blog.gfader.com (my findings) @peitor (my conversations) www.SSW.com.au (my company)
98. References Do you automate your deployment process? (aka Continuous Deployment) http://blog.gfader.com/2010/12/do-you-automate-your-deployment-process.html
99. References Automating Deployment with Microsoft Web Deploy http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx Team Build + Web Deployment + Web Deploy + VS 2010 = Goodness http://vishaljoshi.blogspot.com/2010/11/team-build-web-deployment-web-deploy-vs.html
100. References Web Deployment Made Awesome - Scott Hanselman Video http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx Troy Hunt - Blog Series http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html Web.Config Transformation http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx Web.config Parameters http://msdn.microsoft.com/en-us/library/ff398068.aspx
101. References Releasing features @Flickr http://code.flickr.com/blog/2009/12/02/flipping-out/ 18 questions - Choosing a CI tool http://weblogs.asp.net/rosherove/archive/2010/01/21/18-questions-to-ask-yourself-when-choosing-continuous-integration-and-build-automation-tools.aspx Jez Humble's work blog http://continuousdelivery.com/ Web Deploy 2.0 http://blogs.iis.net/msdeploy/archive/2011/04/05/announcing-web-deploy-2-0-refresh.aspx
Continuous Delivery with TFS, msbuild and msdeployFeel free to copy and use.Drop me a note before though: peter@gfader.com http://blog.gfader.com/
If you are at the stage where you actually have to think about deployment, that is a Success!There are heaps of projects that didn't get so far .... and I was working on some...
Continuous Delivery"Keeping systems production-ready throughout development, so that they can be released to users at any time" Continuous Deployment"Deploy continuously to a certain environment"
From VS: PublishDocx
From VS: PublishDocx
Deployment is hard, because of configuration and starting/stopping of external dependencies (web-servers, DBs, queues, external services, …)(web-servers, DBs, queues, external services, …)
Small feedback cycle
Small feedback cycle
Less number of defects
Less number of defects
Goal of tests: Is application production-ready?
I have VS2010 + TFS as build server + a website hosted on DiscountASPhttp://twitter-fish.com/http://twitter-fish.com/Latest/
Devs check in code to Version control, The automated CI system monitors changes in source control and gets changes. Build and runs all tests. Results are posted back on a portalCI tools are the triggers that listen to various “events’ in the network (a check-in to source control, for example could be a trigger. You can configure these tools to do a few simple things when an event happens. One of those things can be to invoke one of the tools in the previous list. Some of the CI tools, though, include a few simple built in build atomation power (such as built in MSBuild support, or running tests)
Devs check in code to Version control, The automated CI system monitors changes in source control and gets changes. Build and runs all tests. Results are posted back on a portalCI tools are the triggers that listen to various “events’ in the network (a check-in to source control, for example could be a trigger. You can configure these tools to do a few simple things when an event happens. One of those things can be to invoke one of the tools in the previous list. Some of the CI tools, though, include a few simple built in build atomation power (such as built in MSBuild support, or running tests)
Devs check in code to Version control, The automated CI system monitors changes in source control and gets changes. Build and runs all tests. Results are posted back on a portalCI tools are the triggers that listen to various “events’ in the network (a check-in to source control, for example could be a trigger. You can configure these tools to do a few simple things when an event happens. One of those things can be to invoke one of the tools in the previous list. Some of the CI tools, though, include a few simple built in build atomation power (such as built in MSBuild support, or running tests)
In your Build definitionGo to “Process” -> “Advanced” -> “MSBuild arguments” and enter:a. /p:DeployOnBuild=Trueb. /p:DeployTarget=MsDeployPublish/p:Configuration=Release/p:CreatePackageOnPublish=True /p:DeployIisAppPath=[TwitterFish]/p:MsDeployServiceUrl=https://[DiscountAspSERVER]:8172/msdeploy.axd/p:AllowUntrustedCertificate=True
Or use VS2010http://kb.discountasp.net/KB/a792/how-do-i-deploy-visual-studio-2010-web-application.aspx
Deployment is never easy, so try to deploy as soon as possible to remove all roadblocksJuval Löwy encourages the build master to deploy after a couple of days after the project start.
Even with automated tests and UAT there can always slip through a broken release...
Which version of your software is installed in which environment
Deploy to a staging environment, once 100% happy deploy to productionNew Zealand is Facebook guinea pig
Have a clone of your production environment where you deploy and test your software
Deployment artefacts. Trace changes, have history, evolution of code
Deployment artefacts. Trace changes, have history, evolution of code