I deploy on Fridays (and maybe you should too)

2f4800411154a8c66dde489448a044d2?s=47 Michiel Rook
February 22, 2019

I deploy on Fridays (and maybe you should too)

Have you ever heard someone say "Don’t deploy on Friday"? I used to say that too! Learn about resilience and operability, deployments, pipelines and continuous testing. Discover trunk based development, pair programming and best practices, and gain the confidence to deploy any day of the week!

2f4800411154a8c66dde489448a044d2?s=128

Michiel Rook

February 22, 2019
Tweet

Transcript

  1. I DEPLOY ON
 FRIDAYS
 (AND MAYBE YOU SHOULD TOO) MICHIEL

    ROOK
 @MICHIELTCS
  2. @michieltcs

  3. @michieltcs DEPLOYING

  4. @michieltcs ON A FRIDAY

  5. @michieltcs

  6. @michieltcs DEPLOYING?

  7. @michieltcs ON A
 FRIDAY??

  8. None
  9. None
  10. None
  11. None
  12. @michieltcs

  13. @michieltcs BUT WHY?

  14. @michieltcs TRADITION

  15. @michieltcs RISK

  16. @michieltcs CONTROL

  17. @michieltcs CONFIDENCE & TRUST

  18. @michieltcs TIME TO REPAIR / RECOVER

  19. @michieltcs ON-CALL

  20. @michieltcs SO

  21. @michieltcs DON'T DEPLOY ON A FRIDAY!

  22. @michieltcs I USED TO SAY THAT TOO

  23. @michieltcs I LIKE MY WEEKENDS

  24. @michieltcs AND MY EVENINGS

  25. @michieltcs WHAT ABOUT BUGS?

  26. @michieltcs WHAT ABOUT 3 PM?

  27. @michieltcs WHAT ABOUT THURSDAY?

  28. @michieltcs FRIDAY IS 20%
 OF THE WEEK

  29. @michieltcs IMPROVE!

  30. @michieltcs IF IT HURTS
 DO IT MORE OFTEN

  31. @michieltcs FAILURE IS NOT
 THE OPPOSITE OF SUCCESS

  32. SUCCESS CONSISTS OF GOING FROM FAILURE TO FAILURE WITHOUT LOSS

    OF ENTHUSIASM. Winston Churchill
  33. @michieltcs BIG STEPS

  34. @michieltcs FAIL BIG

  35. @michieltcs SMALL STEPS

  36. @michieltcs FAIL SMALL

  37. @michieltcs MAKE IT EFFORTLESS

  38. @michieltcs REDUCE RISK

  39. @michieltcs $ = REALIZED VALUE
 CREDITS TO @FGOULDING

  40. @michieltcs CONTINUOUS EVERYTHING

  41. @michieltcs DELIVERING VALUE TO USERS

  42. @michieltcs SAFELY & QUICKLY

  43. @michieltcs IN A SUSTAINABLE WAY

  44. @michieltcs DEV BUILD / TEST ACCEPTANCE PRODUCTION CONTINUOUS DELIVERY

  45. @michieltcs CODE IS ALWAYS
 IN A RELEASABLE STATE

  46. @michieltcs DEV BUILD / TEST ACCEPTANCE PRODUCTION CONTINUOUS DEPLOYMENT

  47. @michieltcs HIGH VS. LOW PERFORMING TEAMS Source: Accelerate - The

    Science Of DevOps
  48. @michieltcs SO

  49. @michieltcs IF YOU CAN DEPLOY
 ON FRIDAY

  50. @michieltcs AT 5 PM

  51. @michieltcs YOU CAN DEPLOY
 ANY TIME

  52. @michieltcs BUT OUR CODE IS OLD

  53. @michieltcs BUT OUR CODE IS NOT UNDER TEST

  54. @michieltcs BUT OUR CODE IS IMPOSSIBLE TO CHANGE

  55. @michieltcs DEALING WITH "LEGACY"

  56. @michieltcs STRANGLER PATTERN

  57. @michieltcs ORIGINAL MONOLITH DB @michieltcs

  58. @michieltcs ORIGINAL MONOLITH PROXY SERVICE ORIGINAL MONOLITH DB DB DB

    @michieltcs
  59. @michieltcs ORIGINAL MONOLITH PROXY SERVICE ORIGINAL MONOLITH ORIGINAL MONOLITH SERVICE

    SERVICE SERVICE PROXY DB DB DB DB DB DB @michieltcs
  60. @michieltcs BRANCH BY ABSTRACTION

  61. @michieltcs CLIENT OLD MODULE CLIENT CLIENT @michieltcs

  62. @michieltcs CLIENT ABSTRACTION LAYER OLD MODULE CLIENT CLIENT @michieltcs

  63. @michieltcs CLIENT ABSTRACTION LAYER OLD MODULE CLIENT CLIENT @michieltcs

  64. @michieltcs CLIENT ABSTRACTION LAYER OLD MODULE CLIENT CLIENT ABSTRACTION LAYER

    NEW MODULE @michieltcs
  65. @michieltcs CLIENT ABSTRACTION LAYER OLD MODULE CLIENT CLIENT ABSTRACTION LAYER

    NEW MODULE @michieltcs
  66. @michieltcs CLIENT ABSTRACTION LAYER CLIENT CLIENT NEW MODULE @michieltcs

  67. @michieltcs CLIENT NEW MODULE CLIENT CLIENT @michieltcs

  68. @michieltcs ON BRANCHES

  69. @michieltcs CONFLICTS

  70. @michieltcs "This pull request affects 31 files...
 could be a

    lot of conflicts if we don't merge it soon"
  71. @michieltcs

  72. @michieltcs CONTINUOUS INTEGRATION

  73. @michieltcs INTEGRATE TO MASTER
 AT LEAST DAILY

  74. @michieltcs DELAYING INTEGRATION

  75. @michieltcs MERGING FEATURES?

  76. @michieltcs DECOUPLE
 DEPLOYMENTS FROM RELEASES

  77. @michieltcs FEATURE TOGGLES

  78. @michieltcs

  79. @michieltcs @michieltcs

  80. @michieltcs FEATURE TOGGLE DEBT

  81. @michieltcs BRANCHING STRATEGIES

  82. @michieltcs BRANCHING STRATEGIES 1. DON'T BRANCH

  83. @michieltcs BRANCHING STRATEGIES 1. DON'T BRANCH 2. DON'T BRANCH

  84. @michieltcs BRANCHING STRATEGIES 1. DON'T BRANCH 2. DON'T BRANCH 3.

    DON'T BRANCH
  85. @michieltcs

  86. @michieltcs TRUNK
 BASED DEVELOPMENT

  87. @michieltcs SHORT LIVED
 FEATURE BRANCHES?

  88. @michieltcs PULL REQUESTS?

  89. @michieltcs CODE REVIEWS ARE USEFUL

  90. @michieltcs BUT: FLOW DELAY

  91. PAIR PROGRAMMING

  92. @michieltcs CONTINUOUS INLINE
 CODE REVIEW

  93. MOB PROGRAMMING

  94. @michieltcs PIPELINES

  95. @michieltcs AUTOMATION

  96. @michieltcs AUTOMATION
 AUTOMATION

  97. @michieltcs AUTOMATION
 AUTOMATION
 AUTOMATION

  98. @michieltcs COMPILE CHECKOUT TEST PACKAGE

  99. @michieltcs COMPILE CHECKOUT TEST PACKAGE

  100. @michieltcs COMPILE CHECKOUT TEST PACKAGE

  101. @michieltcs COMPILE CHECKOUT TEST PACKAGE

  102. @michieltcs COMPILE CHECKOUT TEST PACKAGE

  103. @michieltcs DEPLOY ACC VERIFY ACC DEPLOY PROD VERIFY PROD

  104. @michieltcs DEPLOY ACC VERIFY ACC DEPLOY PROD VERIFY PROD

  105. @michieltcs DEPLOY ACC VERIFY ACC DEPLOY PROD VERIFY PROD

  106. @michieltcs DEPLOY ACC VERIFY ACC DEPLOY PROD VERIFY PROD

  107. @michieltcs DEPLOY ACC VERIFY ACC DEPLOY PROD VERIFY PROD

  108. @michieltcs CONTINUOUS TESTING

  109. @michieltcs CONTINUOUS TESTING UNIT TESTS ACCEPTANCE TESTS E2E
 TESTS Cost

    Speed INTEGRATION TESTS
  110. @michieltcs CONTINUOUS TESTING UNIT TESTS ACCEPTANCE TESTS E2E
 TESTS Cost

    Speed Exploratory
 testing & user
 feedback Monitoring
 & alerting INTEGRATION TESTS
  111. @michieltcs GOOD ENOUGH

  112. @michieltcs NO TEST SUITE DETECTS EVERY ISSUE

  113. @michieltcs PIPELINE SPEED = KEY

  114. @michieltcs DEPLOYMENTS

  115. @michieltcs ROLLING UPDATE

  116. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.0 SERVICE V1.0 SERVICE

    V1.0 @michieltcs
  117. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.0 SERVICE V1.0 SERVICE

    V1.0 SERVICE V1.1 @michieltcs
  118. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.0 SERVICE V1.1 SERVICE

    V1.0 SERVICE V1.0 @michieltcs
  119. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.0 SERVICE V1.1 SERVICE

    V1.0 SERVICE V1.1 @michieltcs
  120. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.0 SERVICE V1.1 SERVICE

    V1.1 SERVICE V1.0 @michieltcs
  121. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.0 SERVICE V1.1 SERVICE

    V1.1 SERVICE V1.1 @michieltcs
  122. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.1 SERVICE V1.1 SERVICE

    V1.1 SERVICE V1.0 @michieltcs
  123. @michieltcs LOAD BALANCER ROLLING UPDATE SERVICE V1.1 SERVICE V1.1 SERVICE

    V1.1 @michieltcs
  124. @michieltcs pipeline {
 stages {
 stage('Run tests') {
 sh "gradle

    check"
 }
 
 stage('Build docker image') {
 sh "docker build -t jobservice:${env.BUILD_NUMBER} ."
 sh "docker push jobservice:${env.BUILD_NUMBER}"
 }
 
 stage('Deploy staging') {
 sh "ansible-playbook -e BUILD=${env.BUILD_NUMBER}
 -i staging deploy.yml"
 }
 
 stage('Deploy production') {
 sh "ansible-playbook -e BUILD=${env.BUILD_NUMBER}
 -i prod deploy.yml"
 }
 }
 PIPELINE AS CODE image: registry.local/runner:latest
 
 stages:
 - test
 - images
 - deploy
 
 phpunit:
 stage: test
 script:
 - bin/phpunit
 
 images:
 stage: images
 script:
 - make images publish
 only:
 - master
 
 deploy:
 stage: deploy
 script:
 - make deploy
 only:
 - master
  125. @michieltcs BUILD PIPELINE @michieltcs

  126. @michieltcs FEEDBACK!

  127. @michieltcs DEPLOYING

  128. @michieltcs ON A FRIDAY

  129. @michieltcs YOU CAN DO IT TOO!

  130. @michieltcs THANK YOU FOR LISTENING! @michieltcs / michiel@michielrook.nl www.michielrook.nl