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 29, 2016
Tweet

Transcript

  1. The road to Continuous Deployment @BastianHofmann

  2. How many releases?

  3. None
  4. Why?

  5. How?

  6. A few words about me

  7. None
  8. None
  9. None
  10. None
  11. Continuous Deployment

  12. Deploying code changes to production continuously

  13. Classic approach

  14. Waterfall

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

  16. None
  17. Web! Hello?

  18. Agile

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

  20. Going further

  21. Continuous Deployment

  22. Benefits

  23. Smaller change sets

  24. Less Bugs

  25. Finding the bug

  26. Shortest „time to bugfix“ possible

  27. Better performance

  28. Better conversion

  29. Faster iterations

  30. Awesome, I’m sold

  31. How can I introduce it?

  32. The whole team has to live it

  33. Not only doing more releases!

  34. Step by step

  35. is very important

  36. Manual QA

  37. does not scale

  38. Automated Tests

  39. Unit Tests

  40. Integration Tests

  41. Acceptance Tests

  42. Smoke Tests

  43. JS Tests

  44. Regression Tests

  45. Visual Regression Tests

  46. Continuous Integration

  47. None
  48. Development process

  49. The problem with Feature Branches

  50. None
  51. None
  52. Merge Hell

  53. -> Big changes

  54. None
  55. Trunk/master based development

  56. Every commit gets integrated

  57. Every commit gets deployed

  58. No commits that are not stable

  59. Frequent release branches with cherry pics

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

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

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

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

    to develop
  64. Feature Flags/ Toggles

  65. Release !== Deployment

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

    FeatureFlag::TEST_ONE ); }
  67. None
  68. None
  69. Partial rollout

  70. Experiments (A/B Testing)

  71. other also possible: goal early integration

  72. Finally: Getting your code live

  73. Automatic builds

  74. Composer

  75. Bower

  76. NPM

  77. Browserify

  78. Minifying JS

  79. Compiling CSS

  80. Static caches

  81. Ant

  82. Phing

  83. Grunt

  84. None
  85. Custom scripts

  86. Things to look out for

  87. Fast builds

  88. Microservices

  89. Diverse technology stacks

  90. The same for every service

  91. None
  92. Automatic deployment

  93. One-click- deployment

  94. Fast deployment

  95. Fast rollbacks

  96. http://www.ansible.com/

  97. http://capistranorb.com/

  98. Custom scripts

  99. None
  100. Things to look out for

  101. Fast deployments

  102. Fast rollbacks

  103. Availability

  104. Zero Downtime Deployments

  105. Cache warmup

  106. Asset invalidation

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

  108. Microservices

  109. Diverse technology stacks

  110. The same for every service

  111. Hook it into your CI system

  112. Build/Test/Release pipeline

  113. None
  114. https://continuousphp.com/

  115. None
  116. https://mesosphere.github.io/marathon/

  117. None
  118. Schema migrations

  119. None
  120. Non BC breaking

  121. Migration in steps

  122. Only safe operations

  123. No software is bug free

  124. Finding bugs as early as possible

  125. Detecting errors

  126. Central log management

  127. Logstash, Elasticsearch, Kibana

  128. None
  129. Detecting regressions

  130. Bugs

  131. Performance

  132. KPIs

  133. Plotting everything

  134. Finding the cause

  135. Dashboards

  136. None
  137. None
  138. Alerts

  139. None
  140. Anomaly detection

  141. Profiling

  142. Preventing errors

  143. Canary environments

  144. Server Server Server Server

  145. Server Server Server Server Test with low amount of traffic

  146. Synopsis

  147. Invest in your processes

  148. Invest in quality

  149. Invest in performance

  150. Invest in agility

  151. Continuous Deployment

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