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

CODE, TEST, DEPLOY, REPEAT

CODE, TEST, DEPLOY, REPEAT

Continuous delivery, deployment, integration: a lot of buzzwords of our times start with "continuous". But do they exist in real life? Or is this just fantasy? In this session, I'll show how real and impactful CI/CD can be by telling you the story of how we are building "continuous stuff" at VONQ. It's a story about tests, pipelines, automation and feature toggles, but, more importantly, about changing mindsets.

We'll go through each of the stages - coding, testing, deploying (and delivering) - and we'll find out (spoiler!) why the road to continuous delivery is valuable even if you're not going to deploy in production many times per day.

E24c43af87059e1e5602320847b2070d?s=128

Antonello D'Ippolito

July 30, 2019
Tweet

Transcript

  1. CODE TEST DEPLOY REPEAT Antonello D'Ippolito @antodippo

  2. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 2 CONTINUOUS INTEGRATION CONTINUOUS

    DELIVERY CONTINUOUS DEPLOYMENT
  3. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 3 HELLO! Antonello D'Ippolito

    @antodippo backend engineer @
  4. 1. CODE 4

  5. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 5 FAST AND TINY

    PRs CODE REVIEWS PAIR PROGRAMMING CODE
  6. 6 FEATURE TOGGLES

  7. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 7 if (toggleIsOn) {

    $this->newFancyFunctionality(); } else { $this->oldFunctionality(); } FEATURE TOGGLES
  8. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 8 FEATURE TOGGLES https://www.martinfowler.com/articles/feature-toggles.html

  9. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 9 DECOUPLE TOGGLE FROM

    DECISION CENTRALIZE THE LOGIC AVOID CONDITIONALS REMOVE TOGGLES FEATURE TOGGLES
  10. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 10 • github.com/qandidate-labs/qandidate-toggle •

    github.com/qandidate-labs/qandidate-toggle-bundle • github.com/qandidate-labs/qandidate-toggle-api FEATURE TOGGLES qandidate/toggle
  11. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 11 FEATURE TOGGLES qandidate/toggle

    ALWAYS ACTIVE ALWAYS INACTIVE CONDITIONALLY ACTIVE
  12. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 12 FEATURE TOGGLES qandidate/toggle

    // Create the ToggleManager $manager = new ToggleManager(new InMemoryCollection()); // A toggle that will be active when the user id is less than 42 $operator = new LessThan(42); $condition = new OperatorCondition('user_id', $operator); $toggle = new Toggle('toggling', array($condition)); // Add the toggle to the manager $manager->add($toggle); // Create and check a new context for a user with id 42 $context = new Context(); $context->set('user_id', 42); var_dump($manager->active('toggling', $context)); // false
  13. 2. TEST 13

  14. 14

  15. 15

  16. 16

  17. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 17 SMOKE TESTS USER

    ACCEPTANCE TESTS (BEHAT) TEST UI INTEGRATION UNIT INTEGRATION & COMPONENT TESTS (BEHAT, PHPUNIT) UNIT TESTS (PHPSPEC)
  18. 3. DEPLOY 18

  19. “ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 19 IF IT

    HURTS DO IT MORE OFTEN DEPLOY
  20. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 20 DEPLOY

  21. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 21 EVERYONE CAN DEPLOY

    DEPLOY
  22. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 22 PIPELINES (JENKINS) DEPLOY

    SETUP PROJECT TEST SUITES MISC. CHECKS BUILD ARTIFACT SETUP PROJECT TEST SUITES MISC. CHECKS BUILD ARTIFACT DEPLOY ACCEPTANCE SETUP PROJECT TEST SUITES MISC. CHECKS BUILD ARTIFACT DEPLOY PRODUCTION SMOKE TESTS PUSH MERGE TAG ACC. TESTS
  23. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 23 MEASURE & MONITOR

    EVERYTHING DEPLOY • API CALLS RESPONSE TIME • CONTROLLERS LOADING TIME • CRONS EXIT STATUS • ERROR LOGS • ...
  24. 4. DELIVER 24

  25. “ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 25 DECOUPLE DEPLOY

    FROM RELEASE DELIVER
  26. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 26 DELIVER A/B TESTING

    CANARY RELEASE
  27. 5. YES, BUT WHAT'S IN IT FOR ME? 27

  28. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 28 IT SHARPENS YOUR

    DEVOPS SKILLS
  29. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 29 STRESS FREE DEPLOYS

  30. 30

  31. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 31 FAST FEEDBACK •

    FROM CI • FROM MONITORING • FROM USERS
  32. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 32 YOU'RE GONNA FAIL.

    THE PROBLEM IS HOW SOON
  33. 33

  34. “ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 34 EL CAMINO

    ES LA RECOMPENSA Oscar W. Tabárez
  35. “ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 35 You can’t

    do it without automating your entire build, deploy, test, and release process. You can’t do it without a comprehensive, reliable set of automated tests. You can’t do it without writing system tests that run against a production-like environment. Continuous Delivery - Jez Humble, David Farley
  36. “ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 36 That’s why,

    even if you can’t actually release every set of changes that passes all your tests, you should aim to create a process that would let you do so if you choose to. Continuous Delivery - Jez Humble, David Farley
  37. Antonello D'Ippolito CODE TEST DEPLOY REPEAT 37 THANKS! (No canaries

    were harmed in the making of this talk) Antonello D'Ippolito @antodippo