Ideal Deployment In .NET World

2,956 views

Published on

Presented on XP Days Kyiv 17.12.2011

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,956
On SlideShare
0
From Embeds
0
Number of Embeds
415
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Особенно наши футболисты
  • Ideal Deployment In .NET World

    1. 1. IdealDeploymentIn .NET WorldDima Pasko
    2. 2. AboutMe Windows Phone
    3. 3. IntroductionWindows Phone
    4. 4. Human beings make mistakes Windows Phone
    5. 5. We aren’t as accurate every time Windows Phone
    6. 6. Machines don’t have this problem Windows Phone
    7. 7. They do the same thing every time They do the same thing every time Windows Phone
    8. 8. What Do You Need? New Code New Configuration New Database Schema New Static Files
    9. 9. A Lot To Remember Did you remember to upload ALL new files? Did you remember to update your DB? Did you remember to correct your config? Did you remember set permissions?
    10. 10. Even Worse Did you clear your caches? Did you delete that old file/plugin? In the upload process, was your configuration overwritten? Did you upload ALL the changed files? Do you have several environments?
    11. 11. SolutionWindows Phone
    12. 12. Automation! Build scripts!  We are programmers after all…
    13. 13. What Is Automation? Automated deployment means a single command  Locks your live site  Uploads changed files  Clears caches and temporary files  Updates the database schema  Runs other cron tasks  Unlocks your live site  …  Profit
    14. 14. Why Do We Automate? Deployment is tricky Repetition degrades quality  She sells sea shells by the sea shore
    15. 15. When Is Automation Used? All the time!  Staging  Live Probably best to use it on your test/dev box too!
    16. 16. BasicsWindows Phone
    17. 17. Terms Package(build)  Solution != package Environment(settings) Deployment  Rollout  Go Live
    18. 18. Principles One-click deployment Process Everything fails Rollback
    19. 19. Steps Configuration Management Deployment Logic  Database Migration
    20. 20. Configuration ManagementWindows Phone
    21. 21. Xml Configuration XML, XPath, XSLT NConfig  https://github.com/Yegoroff/NConfig
    22. 22. Web.Config Transformation<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <appSettings> <add key="article" value=“test" xdt:Transform="Insert"/> </appSettings></configuration>
    23. 23. DemoWindows Phone
    24. 24. Deployment LogicWindows Phone
    25. 25. Power Shell
    26. 26. PSakeTask default -Depends BuildTask Build -Depends Init,Clean,Compile{ "build"}Task Compile -Depends Clean, Init { "compile"}Task Clean -Depends Init { "clean"}Task Init { "init"}% https://github.com/psake/psake/
    27. 27. NAnt/MSbuild http://nant.sourceforge.net/
    28. 28. DropKick ~ deploy fluently https://github.com/chucknorris/dropkick
    29. 29. MSDeploy
    30. 30. DemoWindows Phone
    31. 31. DB VersioningWindows Phone
    32. 32. Visual Studio Database Project
    33. 33. Migrator.NETusing Migrator.Framework ;using System.Data ;namespace DBMigration{ [Migration(20080401110402)] public class CreateUserTable_001 : Migration { public void Up() { Database.CreateTable ("User", newColumn(" UserId", DbType.Int32, ColumnProperties.PrimaryKeyWithIdentity), new Column("Username", DbType.AnsiString, 25) ); } public void Down() { Database.RemoveTable ("User"); } }} http://code.google.com/p/migratordotnet/
    34. 34. DemoWindows Phone
    35. 35. Release ManagementWindows Phone
    36. 36. Release Management Build Master  http://inedo.com/ Octopus Deploy  http://octopusdeploy.com/ Thought Works Studio – Go  http://www.thoughtworks-studios.com/
    37. 37. One more thingWindows Phone
    38. 38. Push deployment Hg, Git, Svn http://www.heroku.com/
    39. 39. App Harbor Azure done right  git push appharbor master
    40. 40. thanks to• Maxim Tihobrazov• Mike Chaliy• Anatoliy Kolesnick 31337• Anton Vnogradenko• Ivan Korneliuk• Aleksander Yegoroff• Andrey Kashcha• Andrey Kotenko• Andrey Kozhyn
    41. 41. Questions?@dimapaskodimapasko@gmail.comhttp://dotband.com

    ×