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

Continuous Delivery with TFS msbuild msdeploy

11,616

Published on

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.

Published in: Education, Technology
1 Comment
8 Likes
Statistics
Notes
No Downloads
Views
Total Views
11,616
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
208
Comments
1
Likes
8
Embeds 0
No embeds

No notes for slide
  • 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&apos;t get so far .... and I was working on some...
  • Continuous Delivery&quot;Keeping systems production-ready throughout development, so that they can be released to users at any time&quot;  Continuous Deployment&quot;Deploy continuously to a certain environment&quot;
  • 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” -&gt; “Advanced” -&gt; “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&apos;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
  • Transcript of "Continuous Delivery with TFS msbuild msdeploy"

    1. 1. With msbuild and msdeploy<br />Continuous Deployment<br />Delivery <br />-----------<br />
    2. 2. Abstract<br />If you are deploying your software manually, you are doing it wrong. <br />If you deploying once a month, you are doing it wrong. <br />If you as a developer are deploying from Visual Studio by clicking "Publish", you are doing it wrong. <br />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.<br /> <br />Manual deployments are NOT fun. <br />There is a nice way on how to automate the deployment with TFS 2010, msbuild and msdeploy.<br />
    3. 3.
    4. 4. http://twitter.com/#!/DEVOPS_BORAT/status/76767436543758336<br />
    5. 5. Continous Deployment<br />Deploy continously...<br />After each change...<br />To a certain env...<br />Continous Delivery<br />Be production ready...<br />through dev cycle...<br />release any time...<br />
    6. 6. Peter Gfader<br />Australia (my fun)<br />Italy (my country)<br />German (my language)<br />blog.gfader.com (my findings)<br />@peitor (my conversations)<br />www.SSW.com.au (my company)<br />
    7. 7. Deployment Agenda<br />Pain<br />Goals<br />How To<br />Start from scratch<br />Existing System<br />Best Practices<br />
    8. 8. How do you deploy?<br />
    9. 9. How do you deploy?<br /><ul><li>Web App
    10. 10. Client App
    11. 11. SharePoint
    12. 12. CRM</li></ul>...<br /><ul><li>Manual
    13. 13. Publish from VS
    14. 14. Xcopy
    15. 15. Deploy.docx
    16. 16. Deploy.ps</li></li></ul><li>
    17. 17. Pain<br />
    18. 18. "Only Bob knows how to deploy<br /> ... And he is on holidays..."<br />
    19. 19. http://twitter.com/#!/DEVOPS_BORAT/status/55321627000455168<br />
    20. 20. Manual deployments <br />are error prone<br />Deployment Instructions.docx<br />
    21. 21. Manual deployments <br />take hours instead of minutes or seconds<br />Deployment Instructions.docx<br />
    22. 22. Manual deployments <br />take hours instead of minutes or seconds<br />Long feedback cycle <br />We want fail fast<br />Deployment Instructions.docx<br />
    23. 23. Deployments late in the development process<br />cause stress on the "deployment day"<br />
    24. 24. Hard!<br />Configuration <br />Existing data<br />Updates<br />Starting/Stop<br />External dependencies<br />
    25. 25. Manual != fun<br />
    26. 26. http://twitter.com/#!/DEVOPS_BORAT/status/62745218931359744<br />
    27. 27. Goals<br />
    28. 28. Deliver business value faster<br />
    29. 29. Deliver business value faster<br />You spent an hour on a bug fix, but customers will not see it for months<br />
    30. 30. http://twitter.com/#!/DEVOPS_BORAT/status/82255123526598656 <br />
    31. 31. Fail fast and early in the development process<br />
    32. 32. Fail fast and early in the development process<br />On the "Go Live Day" you realize: Production hardware is missing an important feature<br />
    33. 33. Release small increments<br />
    34. 34. Release small increments<br />Deploying often, less number of defects<br />
    35. 35. Start from scratch<br />http://continuousdelivery.com/2010/02/continuous-delivery/<br />
    36. 36. This is the hard part, but some rules of thumb<br />How To<br />
    37. 37. How To<br />Start from Scratch <br />Existing Environment<br />
    38. 38. Start from scratch<br />
    39. 39. Start from scratch<br />1. Setup Continous Integration<br />
    40. 40. Start from scratch<br />1. Setup Continous Integration<br />CI tools<br />TFS<br />TeamCity<br />CruiseControl.NET<br />
    41. 41. Start from scratch<br />1. Setup Continous Integration<br />CI tools<br />Build automation<br />msBuild<br />nAnt<br />nRake<br />FinalBuilder<br />
    42. 42. Start from scratch<br />2. Have automated tests<br />
    43. 43. Start from scratch<br />2. Have automated tests<br />Unit<br />Integration<br />Smoke<br />Acceptance<br />Stresstest<br />BVT<br />WTF?<br />
    44. 44. 3. Setup packaging software<br />
    45. 45. 3. Setup packaging software<br />
    46. 46. 3. Setup packaging software<br />
    47. 47. 3. Setup packaging software<br />Result<br />
    48. 48. Install of package<br /> ----------- - ---<br />
    49. 49. 4. Configuration<br />
    50. 50. 4. Configuration<br />XML Transforms vs<br />XML Parametrization<br />
    51. 51. 1. Web transforms<br /><ul><li>Applied on every deployment
    52. 52. Part of VS2010 (no UI)
    53. 53. XML transform engine is wrapped in msBuild</li></li></ul><li>1. Web transforms<br /><ul><li>Everything that is not environment specific</li></li></ul><li>1. Web transforms<br /><ul><li>Everything that is not environment specific
    54. 54. E.g.Remove all dev settings</li></ul>Debug options<br />..<br />
    55. 55. 2. Web parameterization<br /><ul><li>Applied on every deployment
    56. 56. Run through msDeploy</li></li></ul><li>2. Web parameterization<br />2 parts<br />Declare parameters<br />Set parameters<br />
    57. 57. Additional Configuration settings<br />
    58. 58. Declare Parameters<br />
    59. 59. Set Parameters<br />
    60. 60. Set Parameters<br />
    61. 61. 4. Target environments<br />
    62. 62. Run<br />
    63. 63. Run<br />
    64. 64. Existing Environment<br />Deployment Instructions.docx<br />
    65. 65. Existing Environment<br />Document your manual deployment process<br />Software artefacts<br />Configuration artefacts<br />Target environment(s)<br />
    66. 66. http://twitter.com/#!/DEVOPS_BORAT/status/54693053142798336<br />
    67. 67. Existing Environment<br />2. Improve in baby steps<br />Identify your most expensive manual step<br />Automate that<br />Rinse and repeat<br />
    68. 68. Existing Environment<br />Everyone should work together<br />
    69. 69. Deployment @AuctionsPlus<br /> On a napkin<br />
    70. 70.
    71. 71.
    72. 72.
    73. 73.
    74. 74. Automated Deployment<br />Wed night @Sydney .NET UG<br />
    75. 75.
    76. 76.
    77. 77. Best practices<br />
    78. 78. http://twitter.com/#!/DEVOPS_BORAT/status/65880152705470464<br />
    79. 79. Deploy early<br />Deployment is never easy, so try to deploy as soon as possible to remove all roadblocks<br />
    80. 80. http://twitter.com/#!/DEVOPS_BORAT/status/61213294949707776<br />
    81. 81. Have a rollback plan<br />
    82. 82.
    83. 83. Have a Dashboard<br />Latest Builds?<br />Environment, version?<br />Everything healthy?<br />
    84. 84.
    85. 85.
    86. 86. Have a guinea pig<br />AB testing<br />
    87. 87. Have a clone of your production environment <br />
    88. 88. Have everything under source control<br />
    89. 89. Have everything under source control<br />Deployment artefacts<br />.bat<br />.ps<br />
    90. 90. Log failed and successful builds<br />
    91. 91.
    92. 92. Only let the PO deploy to Production<br />
    93. 93.
    94. 94. Automate<br />Automate<br />Automate<br />Automate<br />Automate<br />Automate<br />Automate<br />Automate<br />Automate<br />
    95. 95.
    96. 96. Thank you!<br />http://twitter.com/DEVOPS_BORAThttp://twitter.com/peitor<br />
    97. 97. Deployment Agenda<br />Pain<br />Goals<br />How To<br />Start from scratch<br />Existing System<br />Best Practices<br />
    98. 98. References<br />Do you automate your deployment process? (aka Continuous Deployment)<br />http://blog.gfader.com/2010/12/do-you-automate-your-deployment-process.html<br />
    99. 99. References<br />Automating Deployment with Microsoft Web Deploy<br />http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx<br />Team Build + Web Deployment + Web Deploy + VS 2010 = Goodness <br />http://vishaljoshi.blogspot.com/2010/11/team-build-web-deployment-web-deploy-vs.html<br />
    100. 100. References<br />Web Deployment Made Awesome - Scott Hanselman Video<br />http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx<br />Troy Hunt - Blog Series<br />http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html<br />Web.Config Transformation<br />http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx<br />Web.config Parameters<br />http://msdn.microsoft.com/en-us/library/ff398068.aspx<br />
    101. 101. References<br />Releasing features @Flickr<br />http://code.flickr.com/blog/2009/12/02/flipping-out/<br />18 questions - Choosing a CI tool<br />http://weblogs.asp.net/rosherove/archive/2010/01/21/18-questions-to-ask-yourself-when-choosing-continuous-integration-and-build-automation-tools.aspx<br />Jez Humble's work blog<br />http://continuousdelivery.com/<br />Web Deploy 2.0<br />http://blogs.iis.net/msdeploy/archive/2011/04/05/announcing-web-deploy-2-0-refresh.aspx<br />
    102. 102. Thank you!<br />Slides and all detailshttp://blog.gfader.com<br />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×