Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The road to Continuous Deployment

The road to Continuous Deployment

Deploying code changes continuously to your production environment has many benefits. New features get to your users much faster which enables very short and quick iterations on them. And due to the small change sets you tend to encounter less bugs and regressions. In this talk I’ll present what Continuous Deployment means, and what you have to do, step-by-step, to make it work successfully for your project. We will cover topics like trunk based development, feature flags, partial roll outs, continuous integration, deployment automation and application monitoring.

Bastian Hofmann

June 27, 2015
Tweet

More Decks by Bastian Hofmann

Other Decks in Programming

Transcript

  1. The road to Continuous Deployment @BastianHofmann

  2. What?

  3. Why?

  4. How?

  5. A few words about me

  6. None
  7. None
  8. Questions? Ask

  9. http://speakerdeck.com/u/bastianhofmann

  10. ?

  11. Company?

  12. Freelancing?

  13. Single product?

  14. Agency?

  15. Continuous Integration?

  16. Continuous Deployment?

  17. Feature flags?

  18. Central log management?

  19. KPIs?

  20. If not, you will after the talk.

  21. How many releases?

  22. None
  23. So

  24. Continuous Deployment

  25. Deploying code changes to production continuously

  26. Classic approach

  27. Waterfall

  28. http://en.wikipedia.org/wiki/File:Waterfall_model.svg

  29. None
  30. Web! Hello?

  31. Agile

  32. http://en.wikipedia.org/wiki/File:Scrum_process.svg

  33. Going further

  34. Continuous Deployment

  35. Benefits

  36. Smaller change sets

  37. Less Bugs

  38. Finding the bug

  39. Shortest „time to bugfix“ possible

  40. Better performance

  41. Better conversion

  42. Faster iterations

  43. Awesome, I’m sold

  44. How can I introduce it?

  45. The whole team has to live it

  46. Not only doing more releases!

  47. Step by step

  48. is very important

  49. Manual QA

  50. does not scale

  51. Automated Tests

  52. Unit Tests

  53. Integration Tests

  54. Acceptance Tests

  55. Smoke Tests

  56. JS Tests

  57. Regression Tests

  58. Continuous Integration

  59. Jenkins http://jenkins-ci.org/

  60. None
  61. Development process

  62. The problem with Feature Branches

  63. None
  64. None
  65. Merge Hell

  66. -> Big changes

  67. Trunk/master based development

  68. Every commit gets integrated

  69. Every commit gets deployed

  70. No commits that are not stable

  71. Frequent release branches with cherry pics

  72. http://paulhammant.com/2013/03/04/facebook-tbd/

  73. http://paulhammant.com/2013/05/06/googles-scaled-trunk-based-development/

  74. http://paulhammant.com/2013/03/04/facebook-tbd/

  75. But there is stuff that takes longer then an hour

    to develop
  76. Feature Flags/ Toggles

  77. Release !== Deployment

  78. public function hasAccess( $accountId, array $roleNames ) { return featureFlag()->isActive(

    FeatureFlag::TEST_ONE ); }
  79. None
  80. None
  81. Partial rollout

  82. Experiments (A/B Testing)

  83. other also possible: goal early integration

  84. Finally: Getting your code live

  85. Automatic builds

  86. Composer

  87. Bower

  88. NPM

  89. Browserify

  90. JS

  91. CSS

  92. HTML

  93. Static caches

  94. Ant

  95. Phing

  96. Grunt

  97. None
  98. Custom scripts

  99. Fast builds

  100. Hook it into Jenkins

  101. Automatic deployment

  102. One-click- deployment

  103. Fast deployment

  104. Fast rollbacks

  105. http://www.ansible.com/

  106. http://capistranorb.com/

  107. Etsy Deploynator http://codeascraft.com/2010/05/20/quantum-of-deployment/

  108. Custom scripts

  109. Cache warmup

  110. Asset invalidation

  111. https://www.npmjs.org/package/grunt-cache-invalidate https://www.npmjs.org/package/gulp-rev https://www.npmjs.org/package/grunt-static-ctrl

  112. Staging System(s)

  113. Central DEV Production Near Production Integration

  114. Build/Test/Release pipeline

  115. None
  116. Schema migrations

  117. None
  118. Non BC breaking

  119. Only safe operations

  120. Migration in steps

  121. No software is bug free

  122. Finding bugs as early as possible

  123. Detecting errors

  124. Central log management

  125. Logstash, Elasticsearch, Kibana

  126. Detecting regressions

  127. Bugs

  128. Performance

  129. KPIs

  130. Plotting everything

  131. Finding the cause

  132. Dashboards

  133. Anomaly detection

  134. Alerts

  135. Profiling

  136. Synopsis

  137. Invest in your processes

  138. Invest in quality

  139. Invest in performance

  140. Invest in agility

  141. Continuous Deployment

  142. https://joind.in/14241

  143. http://twitter.com/BastianHofmann http://lanyrd.com/people/BastianHofmann http://speakerdeck.com/u/bastianhofmann mail@bastianhofmann.de