• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Continuous Delivery with TFS msbuild msdeploy
 

Continuous Delivery with TFS msbuild msdeploy

on

  • 11,730 views

If you are deploying your software manually, you are doing it wrong....

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. See a good way on how to automate the deployment with TFS 2010, msbuild and msdeploy.

Statistics

Views

Total Views
11,730
Views on SlideShare
9,944
Embed Views
1,786

Actions

Likes
7
Downloads
176
Comments
1

7 Embeds 1,786

http://blog.gfader.com 1704
http://feeds.feedburner.com 53
http://paper.li 23
http://translate.googleusercontent.com 2
http://www.linkedin.com 2
http://a0.twimg.com 1
http://www.slideshare.net 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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
  • Tell MSDEPLOY this is a config setting
  • Tell MSDEPLOY this is a config setting
  • Identifysoftware artefactsconfiguration artefactstarget environment(s)
  • (Dev's, Ops, DBAs)
  • 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
  • Authorization
  • http://twitter.com/#!/DEVOPS_BORAT/status/65880152705470464
  • http://twitter.com/#!/DEVOPS_BORAT/status/65880152705470464

Continuous Delivery with TFS msbuild msdeploy Continuous Delivery with TFS msbuild msdeploy Presentation Transcript

  • With msbuild and msdeploy
    Continuous Deployment
    Delivery
    -----------
  • 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.
  • http://twitter.com/#!/DEVOPS_BORAT/status/76767436543758336
  • Continous Deployment
    Deploy continously...
    After each change...
    To a certain env...
    Continous Delivery
    Be production ready...
    through dev cycle...
    release any time...
  • 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)
  • Deployment Agenda
    Pain
    Goals
    How To
    Start from scratch
    Existing System
    Best Practices
  • How do you deploy?
  • How do you deploy?
    • Web App
    • Client App
    • SharePoint
    • CRM
    ...
    • Manual
    • Publish from VS
    • Xcopy
    • Deploy.docx
    • Deploy.ps
  • Pain
  • "Only Bob knows how to deploy
    ... And he is on holidays..."
  • http://twitter.com/#!/DEVOPS_BORAT/status/55321627000455168
  • Manual deployments
    are error prone
    Deployment Instructions.docx
  • Manual deployments
    take hours instead of minutes or seconds
    Deployment Instructions.docx
  • Manual deployments
    take hours instead of minutes or seconds
    Long feedback cycle 
    We want fail fast
    Deployment Instructions.docx
  • Deployments late in the development process
    cause stress on the "deployment day"
  • Hard!
    Configuration
    Existing data
    Updates
    Starting/Stop
    External dependencies
  • Manual != fun
  • http://twitter.com/#!/DEVOPS_BORAT/status/62745218931359744
  • Goals
  • Deliver business value faster
  • Deliver business value faster
    You spent an hour on a bug fix, but customers will not see it for months
  • http://twitter.com/#!/DEVOPS_BORAT/status/82255123526598656
  • Fail fast and early in the development process
  • Fail fast and early in the development process
    On the "Go Live Day" you realize: Production hardware is missing an important feature
  • Release small increments
  • Release small increments
    Deploying often, less number of defects
  • Start from scratch
    http://continuousdelivery.com/2010/02/continuous-delivery/
  • This is the hard part, but some rules of thumb
    How To
  • How To
    Start from Scratch
    Existing Environment
  • Start from scratch
  • Start from scratch
    1. Setup Continous Integration
  • Start from scratch
    1. Setup Continous Integration
    CI tools
    TFS
    TeamCity
    CruiseControl.NET
  • Start from scratch
    1. Setup Continous Integration
    CI tools
    Build automation
    msBuild
    nAnt
    nRake
    FinalBuilder
  • Start from scratch
    2. Have automated tests
  • Start from scratch
    2. Have automated tests
    Unit
    Integration
    Smoke
    Acceptance
    Stresstest
    BVT
    WTF?
  • 3. Setup packaging software
  • 3. Setup packaging software
  • 3. Setup packaging software
  • 3. Setup packaging software
    Result
  • Install of package
    ----------- - ---
  • 4. Configuration
  • 4. Configuration
    XML Transforms vs
    XML Parametrization
  • 1. Web transforms
    • Applied on every deployment
    • Part of VS2010 (no UI)
    • XML transform engine is wrapped in msBuild
  • 1. Web transforms
    • Everything that is not environment specific
  • 1. Web transforms
    • Everything that is not environment specific
    • E.g.Remove all dev settings
    Debug options
    ..
  • 2. Web parameterization
    • Applied on every deployment
    • Run through msDeploy
  • 2. Web parameterization
    2 parts
    Declare parameters
    Set parameters
  • Additional Configuration settings
  • Declare Parameters
  • Set Parameters
  • Set Parameters
  • 4. Target environments
  • Run
  • Run
  • Existing Environment
    Deployment Instructions.docx
  • Existing Environment
    Document your manual deployment process
    Software artefacts
    Configuration artefacts
    Target environment(s)
  • http://twitter.com/#!/DEVOPS_BORAT/status/54693053142798336
  • Existing Environment
    2. Improve in baby steps
    Identify your most expensive manual step
    Automate that
    Rinse and repeat
  • Existing Environment
    Everyone should work together
  • Deployment @AuctionsPlus
    On a napkin
  • Automated Deployment
    Wed night @Sydney .NET UG
  • Best practices
  • http://twitter.com/#!/DEVOPS_BORAT/status/65880152705470464
  • Deploy early
    Deployment is never easy, so try to deploy as soon as possible to remove all roadblocks
  • http://twitter.com/#!/DEVOPS_BORAT/status/61213294949707776
  • Have a rollback plan
  • Have a Dashboard
    Latest Builds?
    Environment, version?
    Everything healthy?
  • Have a guinea pig
    AB testing
  • Have a clone of your production environment
  • Have everything under source control
  • Have everything under source control
    Deployment artefacts
    .bat
    .ps
  • Log failed and successful builds
  • Only let the PO deploy to Production
  • Automate
    Automate
    Automate
    Automate
    Automate
    Automate
    Automate
    Automate
    Automate
  • Thank you!
    http://twitter.com/DEVOPS_BORAThttp://twitter.com/peitor
  • Deployment Agenda
    Pain
    Goals
    How To
    Start from scratch
    Existing System
    Best Practices
  • References
    Do you automate your deployment process? (aka Continuous Deployment)
    http://blog.gfader.com/2010/12/do-you-automate-your-deployment-process.html
  • 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
  • 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
  • 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
  • Thank you!
    Slides and all detailshttp://blog.gfader.com