Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
CONTINUOUS DEPLOYMENT 2.0
PLAYTIME IS OVER
in itPROFESSIONAL PHP SERVICES
‣ CEO and co-founder of in2it
‣ Community leader
‣ OSS contributor
‣ Conference Speaker
‣ C...
MICHIEL ROOK
OUR CD WAS INSPIRED BY
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
MICHIEL’S TALK WAS TO SAY THE LEAST…
QUITE CONTROVERSIAL
▸ deploy to master, no branches
▸ pair programming, quick code re...
THAT GOT US
THINKING…
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
LEGACY
APPLICATIONS
COMMON FOR ALL CLIENTS:
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
IN2IT PROCESSES?
? ? ?
?
???
?
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
REFACTORING
ADDING FEATURES
REWRITE FROM SCRATCH
TESTING IS HARD
ONLY NEW FEATURES TESTED
LOTS OF WORK
Continuous Deployme...
SUPER
HERO
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
IN2IT PROCESSES
ONLY MASTER PAIR PROGRAMMING 100% CODE COVERAGE STRANGLER PATTERN
Continuous Deployment 2.0www.in2it.be - ...
IN2IT PROCESSES
ONLY MASTER ❌ PAIR PROGRAMMING 100% CODE COVERAGE STRANGLER PATTERN
Continuous Deployment 2.0www.in2it.be ...
IN2IT PROCESSES
ONLY MASTER ❌ PAIR PROGRAMMING ✅ 100% CODE COVERAGE STRANGLER PATTERN
Continuous Deployment 2.0www.in2it.b...
IN2IT PROCESSES
ONLY MASTER ❌ PAIR PROGRAMMING ✅ 100% CODE COVERAGE ✅ STRANGLER PATTERN
Continuous Deployment 2.0www.in2it...
IN2IT PROCESSES
ONLY MASTER ❌ PAIR PROGRAMMING ✅ 100% CODE COVERAGE ✅ STRANGLER PATTERN ❌
Continuous Deployment 2.0www.in2...
LET’S SEE WHAT WE’RE MISSING
DO WE NEED TO COMMIT TO MASTER?
▸ All PR’s are going into master branch
▸ Every developer has...
DEVELOPERS WORK LOCALLY ON A PRIVATE GIT REPO
OUR GIT WORKFLOW
DEVELOPER
PRIVATE REPO
DEVELOPER
PRIVATE REPO
Continuous De...
ONCE DONE, THEY PUSH TO THEIR PUBLIC REPOS
OUR GIT WORKFLOW
DEVELOPER
PRIVATE REPO
DEVELOPER
PRIVATE REPO
DEVELOPER
PUBLIC...
AND SEND A PULL REQUEST (PR)
OUR GIT WORKFLOW
DEVELOPER
PRIVATE REPO
DEVELOPER
PRIVATE REPO
DEVELOPER
PUBLIC REPO
DEVELOPE...
OUR RELEASE MANAGER MERGES THE CHANGES IN
OUR GIT WORKFLOW
DEVELOPER
PRIVATE REPO
DEVELOPER
PRIVATE REPO
DEVELOPER
PUBLIC ...
CI KICKS IN AND DEPLOYS TO TEST/STAGING/PROD
OUR GIT WORKFLOW
DEVELOPER
PRIVATE REPO
DEVELOPER
PRIVATE REPO
DEVELOPER
PUBL...
OUR CONCLUSION
COMMITTING STRAIGHT TO MASTER
▸ Will make the role of “Release Master” obsolete
▸ Good for small teams
▸ Sp...
LET’S SEE WHAT WE’RE MISSING…
STRANGLER PATTERN
▸ Is a clean way to replace legacy code with
clean, distributed and optimi...
INCREMENTALLY MIGRATE A LEGACY SYSTEM BY GRADUALLY
REPLACING SPECIFIC PIECES OF FUNCTIONALITY WITH NEW
APPLICATIONS AND SE...
LEGACY APPLICATION
NEW
REPLACEMENT
STRANGLER FAÇADE
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
NEW REPLACEMENT
STRANGLER FAÇADE
LEGACY
APPLICATION
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
OUR CONCLUSION
STRANGLING LEGACY CODE
▸ Will take time to replace old with new code
▸ Until ready, duplicated functional w...
IMPROVING LEGACY
THE PATH TO
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
PEAR LIBS PECL EXTS
FRAMEWORK
X
FRAMEWORK
Y
CUSTOM
LIBS
BUSINESS LOGIC
Monolithic Code Monster
Continuous Deployment 2.0ww...
WE NEED A BETTER
SOLUTION!
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
PEAR LIBS PECL EXTS
FRAMEWORK
X
FRAMEWORK
Y
CUSTOM
LIBS
BUSINESS LOGIC
Monolithic Code Monster
FUNCTIONAL MICROSERVICE FUN...
I CAN HEAR YOU ASK:
WHY MICROSERVICES?
▸ Not tied to a single technology
▸ A service per functionality makes it easier to
...
MICROSERVICES SIND
SINNVOLL!
Stefan Hogdörfer - @shochdoerfer
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
LET’S LOOK IF IT IS A SOLUTION FOR US
PROS EN CONS
Pro Con
Not tied to a single technology Lots of different skillsets
Eas...
MICROSERVICES &
CONTINUOUS DEPLOYMENT
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
GOALS OF CONTINUOUS
DEPLOYMENT?
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
CONTINUOUS DEPLOYMENT CAN BE THOUGHT OF
AS AN EXTENSION OF CONTINUOUS INTEGRATION,
AIMING AT MINIMIZING LEAD TIME, THE TIM...
DOING THINGS MORE THAN ONCE LEAD UP TO…
AUTOMATE DEPLOYMENT PROCESSES
▸ A series of actions taken before changes are
put i...
COMPUTERS ARE GREAT AT REPETITIVE TASKS!
MINIMIZE LEAD TIME
▸ Through automation, actions are executed
faster in parallel
...
STRESS, PANIC, SICKNESS, … ALL HAVE AN IMPACT ON YOUR CONCENTRATION
PREVENTING HUMAN ERROR!
▸ Automation removes human err...
PROGRAMMING
AGREEMENTS
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
COMMIT SMALL, COMMIT OFTEN
Credits to @CalEvans
THE PROGRAMMER’S MANTRA
Continuous Deployment 2.0www.in2it.be - @in2itvofi...
PERFECT WORLD WOULD MAKE THIS POSSIBLE
OPTIMAL COMMIT
▸ creating/updating class (no body)
▸ creating/changing class method...
ON THIS PLANET WE ARE SATISFIED WITH THIS
REALISTIC COMMIT
▸ complete a functionality
▸ complete a logic operation
▸ compl...
SMALL AND OFTEN COMMITS BALANCE
PROS EN CONS
Pro Con
Incremental small improvements Many commits for one task
Errors can b...
AIM FOR 100% CODE COVERAGE
Michiel Rook - @michielcts
LET’S GO FOR IT!
Continuous Deployment 2.0www.in2it.be - @in2itvofin...
SMALL CHANGES REQUIRE MINIMAL OVERHEAD
COMMIT SMALL WITH 100% COVERAGE
▸ small code change
▸ small test covering all lines...
EXAMPLE OF USING THE @COVERS ANNOTATION
/**
 * Authentication throws exception for too short password
 *
 * @param string ...
EXAMPLE OF USING THE @COVERS ANNOTATION
/**
 * Authentication throws exception for too short password
 *
 * @param string ...
SHOULD WE ADOPT 100% CODE COVERAGE?
PROS EN CONS
Pro Con
Higher quality of code A huge effort
Every line of code is accoun...
THE PIPELINE
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
A COMMON CI/CD SETUP
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
WE CAN DO BETTER!
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
THE BEGINNING OF A BEAUTIFUL STORY
CODE ASSEMBLY STEP
▸ Check out SCM
▸ Optionally install submodules
▸ Composer packages
...
ARE WE GOOD TO GO?
CODE QUALITY STEP
▸ Version checks (are we on latest version?)
▸ Vulnerability checks (CVE’s)*
▸ Unit t...
LET’S PREPARE EVERYTHING LIKE A TRUE CHEF
PROVISIONING STEP
▸ Create a new environment
▸ Package the code and assets
▸ Sig...
TEST ALL THE THINGS, AND ADD SOME…
RELEASE QUALITY STEP
▸ Integration testing
▸ Acceptance testing
▸ End-to-end testing
▸ ...
TIME TO SHIP IT!!!
DEPLOYMENT STEP
▸ Stop crons, workers and daemons
▸ Phase out old system with new
▸ Put new system in l...
KNOWING IS GOOD, KNOWING EVERYTHING IS BETTER - DAVE EGGARS “THE CIRCLE”
REPORTING STEP
▸ Generate release notes
▸ Generat...
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
WITH PIPELINES YOU HAVE…
ENDLESS POSSIBILITIES TO DEPLOY
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
AND WHEN SOMETHING DOES GOES WRONG…
THE PIPELINE WILL STOP…
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
WE ROLL FORWARD
WHEN FAILURE HAPPENS
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
YOUR TURN
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
TEST IT ALL!
CONTINUOUS DEPLOYMENT
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
SMALL REMINDER
BY DESIGN
▸ Quality
▸ Security
▸ Privacy
▸ Resilience
▸ Accessibility
Continuous Deployment 2.0www.in2it.be...
SET AGREEMENTS AS
A TEAM
IN NEED OF STRUCTURE?
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
WITH PIPELINES
SUCCEED EVERY TIME
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
IMPROVE THE
FEEDBACK LOOP
KNOWLEDGE IS KEY!
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
RESOURCES THAT INSPIRED ME…
RECOMMENDED FOR YOU
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
Use
For feedback on this presentation For discussions on this presentation
Use
Continuous Deployment 2.0www.in2it.be - @in...
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
QUESTIONS?
ARE THERE ANY
Continuous Deployment 2.0www.in2it.be - @in2itvofin it
Nächste SlideShare
Wird geladen in …5
×

Continuous deployment 2.0

378 Aufrufe

Veröffentlicht am

Continuous Deployment, TDD and Continuous Integration is nothing new anymore and many of you are already veterans deploying multiple times each day code into production. But you’re still suffering from cutting corners and doing something quick on production when time is pressing, violating the processes you all worked hard on to get approved.

In this talk we take this very concept to the next level and show you how we used unconventional ways to deploy faster with less issues and regained control over a 10+ year old legacy application.

Veröffentlicht in: Ingenieurwesen
  • Als Erste(r) kommentieren

Continuous deployment 2.0

  1. 1. CONTINUOUS DEPLOYMENT 2.0 PLAYTIME IS OVER
  2. 2. in itPROFESSIONAL PHP SERVICES ‣ CEO and co-founder of in2it ‣ Community leader ‣ OSS contributor ‣ Conference Speaker ‣ Coach at CoderDojo MICHELANGELO VAN DAM
  3. 3. MICHIEL ROOK OUR CD WAS INSPIRED BY Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  4. 4. MICHIEL’S TALK WAS TO SAY THE LEAST… QUITE CONTROVERSIAL ▸ deploy to master, no branches ▸ pair programming, quick code reviews ▸ 100% code coverage ▸ strangler pattern to replace 10+ year old legacy app Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  5. 5. THAT GOT US THINKING… Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  6. 6. LEGACY APPLICATIONS COMMON FOR ALL CLIENTS: Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  7. 7. IN2IT PROCESSES? ? ? ? ? ??? ? Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  8. 8. REFACTORING ADDING FEATURES REWRITE FROM SCRATCH TESTING IS HARD ONLY NEW FEATURES TESTED LOTS OF WORK Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  9. 9. SUPER HERO Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  10. 10. IN2IT PROCESSES ONLY MASTER PAIR PROGRAMMING 100% CODE COVERAGE STRANGLER PATTERN Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  11. 11. IN2IT PROCESSES ONLY MASTER ❌ PAIR PROGRAMMING 100% CODE COVERAGE STRANGLER PATTERN Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  12. 12. IN2IT PROCESSES ONLY MASTER ❌ PAIR PROGRAMMING ✅ 100% CODE COVERAGE STRANGLER PATTERN Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  13. 13. IN2IT PROCESSES ONLY MASTER ❌ PAIR PROGRAMMING ✅ 100% CODE COVERAGE ✅ STRANGLER PATTERN Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  14. 14. IN2IT PROCESSES ONLY MASTER ❌ PAIR PROGRAMMING ✅ 100% CODE COVERAGE ✅ STRANGLER PATTERN ❌ Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  15. 15. LET’S SEE WHAT WE’RE MISSING DO WE NEED TO COMMIT TO MASTER? ▸ All PR’s are going into master branch ▸ Every developer has their own GIT repo ▸ Branching for features ▸ Branching for bug fixes ▸ Deployment Master ▸ Integrates one or more dev branches ▸ Pushes it onto master Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  16. 16. DEVELOPERS WORK LOCALLY ON A PRIVATE GIT REPO OUR GIT WORKFLOW DEVELOPER PRIVATE REPO DEVELOPER PRIVATE REPO Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  17. 17. ONCE DONE, THEY PUSH TO THEIR PUBLIC REPOS OUR GIT WORKFLOW DEVELOPER PRIVATE REPO DEVELOPER PRIVATE REPO DEVELOPER PUBLIC REPO DEVELOPER PUBLIC REPO Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  18. 18. AND SEND A PULL REQUEST (PR) OUR GIT WORKFLOW DEVELOPER PRIVATE REPO DEVELOPER PRIVATE REPO DEVELOPER PUBLIC REPO DEVELOPER PUBLIC REPO TEAM REPO RELEASE BRANCH Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  19. 19. OUR RELEASE MANAGER MERGES THE CHANGES IN OUR GIT WORKFLOW DEVELOPER PRIVATE REPO DEVELOPER PRIVATE REPO DEVELOPER PUBLIC REPO DEVELOPER PUBLIC REPO TEAM REPO MASTER BRANCH RELEASE MANAGER Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  20. 20. CI KICKS IN AND DEPLOYS TO TEST/STAGING/PROD OUR GIT WORKFLOW DEVELOPER PRIVATE REPO DEVELOPER PRIVATE REPO DEVELOPER PUBLIC REPO DEVELOPER PUBLIC REPO TEAM REPO MASTER BRANCH RELEASE MANAGERCI TEST/STAGING/PROD Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  21. 21. OUR CONCLUSION COMMITTING STRAIGHT TO MASTER ▸ Will make the role of “Release Master” obsolete ▸ Good for small teams ▸ Speeds up the deployment process ▸ In our case ▸ We work with distributed teams (3-5 people in each team) ▸ Will only work when all features are live from the start (feature flags) Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  22. 22. LET’S SEE WHAT WE’RE MISSING… STRANGLER PATTERN ▸ Is a clean way to replace legacy code with clean, distributed and optimised code. ▸ Requires domain knowledge (especially for 10+ years of evolution of an app) ▸ Creates duplicate functionality during transitions Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  23. 23. INCREMENTALLY MIGRATE A LEGACY SYSTEM BY GRADUALLY REPLACING SPECIFIC PIECES OF FUNCTIONALITY WITH NEW APPLICATIONS AND SERVICES. AS FEATURES FROM THE LEGACY SYSTEM ARE REPLACED, THE NEW SYSTEM EVENTUALLY REPLACES ALL OF THE OLD SYSTEM'S FEATURES, STRANGLING THE OLD SYSTEM AND ALLOWING YOU TO DECOMMISSION IT. Microsoft Cloud Architecture Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  24. 24. LEGACY APPLICATION NEW REPLACEMENT STRANGLER FAÇADE Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  25. 25. NEW REPLACEMENT STRANGLER FAÇADE LEGACY APPLICATION Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  26. 26. OUR CONCLUSION STRANGLING LEGACY CODE ▸ Will take time to replace old with new code ▸ Until ready, duplicated functional will exist ▸ In our case ▸ We need to replace legacy code with better solutions ▸ We can live with duplicated functionality Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  27. 27. IMPROVING LEGACY THE PATH TO Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  28. 28. PEAR LIBS PECL EXTS FRAMEWORK X FRAMEWORK Y CUSTOM LIBS BUSINESS LOGIC Monolithic Code Monster Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  29. 29. WE NEED A BETTER SOLUTION! Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  30. 30. PEAR LIBS PECL EXTS FRAMEWORK X FRAMEWORK Y CUSTOM LIBS BUSINESS LOGIC Monolithic Code Monster FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE FUNCTIONAL MICROSERVICE Functional Microservices Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  31. 31. I CAN HEAR YOU ASK: WHY MICROSERVICES? ▸ Not tied to a single technology ▸ A service per functionality makes it easier to upgrade without impacting the whole application ▸ Improved security on application, network and infrastructure ▸ Easy to scale and extend ▸ Better resilience against failing services Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  32. 32. MICROSERVICES SIND SINNVOLL! Stefan Hogdörfer - @shochdoerfer Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  33. 33. LET’S LOOK IF IT IS A SOLUTION FOR US PROS EN CONS Pro Con Not tied to a single technology Lots of different skillsets Easy to upgrade/fix or add features Lost in forrest of services Improved security Requires lots of monitoring Better scalability Expensive* Improved resilience for failure (*) The cost lies in the higher number of “instances” and faster network required to run these services Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  34. 34. MICROSERVICES & CONTINUOUS DEPLOYMENT Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  35. 35. GOALS OF CONTINUOUS DEPLOYMENT? Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  36. 36. CONTINUOUS DEPLOYMENT CAN BE THOUGHT OF AS AN EXTENSION OF CONTINUOUS INTEGRATION, AIMING AT MINIMIZING LEAD TIME, THE TIME ELAPSED BETWEEN DEVELOPMENT WRITING ONE NEW LINE OF CODE AND THIS NEW CODE BEING USED BY LIVE USERS, IN PRODUCTION. Agile Alliance - agilealliance.com Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  37. 37. DOING THINGS MORE THAN ONCE LEAD UP TO… AUTOMATE DEPLOYMENT PROCESSES ▸ A series of actions taken before changes are put in production ▸ Chained together with fail switch to create a pipeline ▸ Provides full reports on each step of the delivery process ▸ Can be optimized over time ▸ Is repeatable Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  38. 38. COMPUTERS ARE GREAT AT REPETITIVE TASKS! MINIMIZE LEAD TIME ▸ Through automation, actions are executed faster in parallel ▸ Any failures will be reported immediately ▸ Any successes will be notified through ▸ E-mail ▸ Wiki ▸ Slack ▸ … Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  39. 39. STRESS, PANIC, SICKNESS, … ALL HAVE AN IMPACT ON YOUR CONCENTRATION PREVENTING HUMAN ERROR! ▸ Automation removes human errors ▸ by stress or a “bad” day ▸ Optimized over time ▸ Repeatable for all stages Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  40. 40. PROGRAMMING AGREEMENTS Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  41. 41. COMMIT SMALL, COMMIT OFTEN Credits to @CalEvans THE PROGRAMMER’S MANTRA Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  42. 42. PERFECT WORLD WOULD MAKE THIS POSSIBLE OPTIMAL COMMIT ▸ creating/updating class (no body) ▸ creating/changing class method (no body) ▸ creating/changing functionality in method ▸ creating/changing config (no body) ▸ … Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  43. 43. ON THIS PLANET WE ARE SATISFIED WITH THIS REALISTIC COMMIT ▸ complete a functionality ▸ complete a logic operation ▸ complete a configuration change Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  44. 44. SMALL AND OFTEN COMMITS BALANCE PROS EN CONS Pro Con Incremental small improvements Many commits for one task Errors can be reverted quickly Requires change of attitude Easy to review Small impact on production code Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  45. 45. AIM FOR 100% CODE COVERAGE Michiel Rook - @michielcts LET’S GO FOR IT! Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  46. 46. SMALL CHANGES REQUIRE MINIMAL OVERHEAD COMMIT SMALL WITH 100% COVERAGE ▸ small code change ▸ small test covering all lines ▸ make use of @covers annotation ▸ Run PHPUnit with “--strict-coverage” Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  47. 47. EXAMPLE OF USING THE @COVERS ANNOTATION /**  * Authentication throws exception for too short password  *  * @param string $password  *  * @covers LoginFormAuthServiceAuthenticationService::__construct  * @covers LoginFormAuthServiceAuthenticationService::authenticate  * @dataProvider shortPasswordProvider  * @expectedException InvalidArgumentException  */ public function testAuthenticationThrowsExceptionForTooShortPassword(string $password) {     $this->validator->expects($this->once())         ->method('isValid')         ->willReturn(false);     $authService = new AuthenticationService(         $this->validator,         $this->accountModel,         $this->accountEntity,         $this->twoFactorServiceMock     );     $authService->authenticate('username', $password, false);     $this->fail('Authentication service should throw an exception for too short password input'); } Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  48. 48. EXAMPLE OF USING THE @COVERS ANNOTATION /**  * Authentication throws exception for too short password  *  * @param string $password  *  * @covers LoginFormAuthServiceAuthenticationService::__construct  * @covers LoginFormAuthServiceAuthenticationService::authenticate  * @dataProvider shortPasswordProvider  * @expectedException InvalidArgumentException  */ public function testAuthenticationThrowsExceptionForTooShortPassword(string $password) {     $this->validator->expects($this->once())         ->method('isValid')         ->willReturn(false);     $authService = new AuthenticationService(         $this->validator,         $this->accountModel,         $this->accountEntity,         $this->twoFactorServiceMock     );     $authService->authenticate('username', $password, false);     $this->fail('Authentication service should throw an exception for too short password input'); } Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  49. 49. SHOULD WE ADOPT 100% CODE COVERAGE? PROS EN CONS Pro Con Higher quality of code A huge effort Every line of code is accountable Requires change of attitude Huge time/money gain in long tail Time intensive Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  50. 50. THE PIPELINE Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  51. 51. A COMMON CI/CD SETUP Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  52. 52. WE CAN DO BETTER! Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  53. 53. THE BEGINNING OF A BEAUTIFUL STORY CODE ASSEMBLY STEP ▸ Check out SCM ▸ Optionally install submodules ▸ Composer packages Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  54. 54. ARE WE GOOD TO GO? CODE QUALITY STEP ▸ Version checks (are we on latest version?) ▸ Vulnerability checks (CVE’s)* ▸ Unit testing ▸ Static Analysis (*) See SensioLabs for composer package validation service Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  55. 55. LET’S PREPARE EVERYTHING LIKE A TRUE CHEF PROVISIONING STEP ▸ Create a new environment ▸ Package the code and assets ▸ Sign the package with GPG ▸ Deploy the code ▸ Perform DB migrations ▸ Warm-up caches Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  56. 56. TEST ALL THE THINGS, AND ADD SOME… RELEASE QUALITY STEP ▸ Integration testing ▸ Acceptance testing ▸ End-to-end testing ▸ Regression testing ▸ Performance testing ▸ Security testing ▸ Resilience testing ▸ Accessibility testing ▸ UX Testing ▸ … Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  57. 57. TIME TO SHIP IT!!! DEPLOYMENT STEP ▸ Stop crons, workers and daemons ▸ Phase out old system with new ▸ Put new system in load balancer ▸ Direct portion of traffic to new node ▸ Validate behaviour of new node ▸ Remove old system from load balancer ▸ Validate deployment ▸ Start crons, workers and daemons Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  58. 58. KNOWING IS GOOD, KNOWING EVERYTHING IS BETTER - DAVE EGGARS “THE CIRCLE” REPORTING STEP ▸ Generate release notes ▸ Generate user documentation ▸ Notify training dept. of changes ▸ Generate release report/stats Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  59. 59. Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  60. 60. Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  61. 61. WITH PIPELINES YOU HAVE… ENDLESS POSSIBILITIES TO DEPLOY Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  62. 62. AND WHEN SOMETHING DOES GOES WRONG… THE PIPELINE WILL STOP… Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  63. 63. WE ROLL FORWARD WHEN FAILURE HAPPENS Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  64. 64. YOUR TURN Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  65. 65. TEST IT ALL! CONTINUOUS DEPLOYMENT Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  66. 66. SMALL REMINDER BY DESIGN ▸ Quality ▸ Security ▸ Privacy ▸ Resilience ▸ Accessibility Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  67. 67. SET AGREEMENTS AS A TEAM IN NEED OF STRUCTURE? Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  68. 68. WITH PIPELINES SUCCEED EVERY TIME Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  69. 69. IMPROVE THE FEEDBACK LOOP KNOWLEDGE IS KEY! Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  70. 70. RESOURCES THAT INSPIRED ME… RECOMMENDED FOR YOU Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  71. 71. Use For feedback on this presentation For discussions on this presentation Use Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  72. 72. Continuous Deployment 2.0www.in2it.be - @in2itvofin it
  73. 73. QUESTIONS? ARE THERE ANY Continuous Deployment 2.0www.in2it.be - @in2itvofin it

×