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.

Ded87c77266697ee6981c2277bb97633?s=128

Bastian Hofmann

October 31, 2015
Tweet

Transcript

  1. None
  2. What?

  3. Why?

  4. How?

  5. A few words about me

  6. None
  7. None
  8. http://speakerdeck.com/u/bastianhofmann

  9. None
  10. How many releases?

  11. Continuous Integration?

  12. Continuous Deployment?

  13. Feature flags?

  14. Central log management?

  15. KPIs?

  16. If not, you will after the talk.

  17. None
  18. So

  19. Continuous Deployment

  20. Deploying code changes to production continuously

  21. Classic approach

  22. Waterfall

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

  24. None
  25. Web! Hello?

  26. Agile

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

  28. Going further

  29. Continuous Deployment

  30. Benefits

  31. Smaller change sets

  32. Less Bugs

  33. Finding the bug

  34. Shortest „time to bugfix“ possible

  35. Better performance

  36. Better conversion

  37. Faster iterations

  38. Awesome, I’m sold

  39. How can I introduce it?

  40. The whole team has to live it

  41. Not only doing more releases!

  42. Step by step

  43. is very important

  44. Manual QA

  45. does not scale

  46. Automated Tests

  47. Unit Tests

  48. Integration Tests

  49. Acceptance Tests

  50. Smoke Tests

  51. JS Tests

  52. Regression Tests

  53. Continuous Integration

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

  55. None
  56. Development process

  57. The problem with Feature Branches

  58. None
  59. None
  60. Merge Hell

  61. -> Big changes

  62. Trunk/master based development

  63. Every commit gets integrated

  64. Every commit gets deployed

  65. No commits that are not stable

  66. Frequent release branches with cherry pics

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

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

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

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

    to develop
  71. Feature Flags/ Toggles

  72. Release !== Deployment

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

    FeatureFlag::TEST_ONE ); }
  74. None
  75. None
  76. Partial rollout

  77. Experiments (A/B Testing)

  78. other also possible: goal early integration

  79. Finally: Getting your code live

  80. Automatic builds

  81. Composer

  82. Bower

  83. NPM

  84. Browserify

  85. JS

  86. CSS

  87. HTML

  88. Static caches

  89. Ant

  90. Phing

  91. Grunt

  92. None
  93. Custom scripts

  94. Fast builds

  95. Hook it into Jenkins

  96. Automatic deployment

  97. One-click- deployment

  98. Fast deployment

  99. Fast rollbacks

  100. http://www.ansible.com/

  101. http://capistranorb.com/

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

  103. Custom scripts

  104. Zero downtime

  105. Minimize the amount of time you have two different versions

    online in parallel
  106. LB Green Blue

  107. LB Green Blue Deploy new version

  108. LB Green Blue

  109. Attention: Path changes

  110. Cache warmup

  111. Asset invalidation

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

  113. Let’s deploy something

  114. Staging System(s)

  115. Central DEV Production Near Production Integration

  116. Build/Test/Release pipeline

  117. None
  118. Keep it fast

  119. Allow manual shortcuts

  120. Schema migrations

  121. None
  122. Non BC breaking

  123. Only safe operations

  124. Migration in steps

  125. No software is bug free

  126. Finding bugs as early as possible

  127. Detecting errors

  128. Central log management

  129. Logstash, Elasticsearch, Kibana

  130. Detecting regressions

  131. Bugs

  132. Performance

  133. KPIs

  134. Plotting everything

  135. Finding the cause

  136. Dashboards

  137. Anomaly detection

  138. Alerts

  139. Profiling

  140. Synopsis

  141. Invest in quality

  142. Invest in performance

  143. Invest in your processes

  144. Invest in agility

  145. Continuous Deployment

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