SlideShare a Scribd company logo
1 of 30
Download to read offline
Improving the deployment Process
Step by Step
About me
Daniel Fahlke (aka Flyingmana)
● Working as a Software Engineer with Magento and PHP
● Doing lots of open Source
● Helps maintaining the OpenMage-LTS Fork
● http://flyingmana.name/
● https://github.com/Flyingmana
● https://twitter.com/Flyingmana
● https://www.patreon.com/Flyingmana
● https://github.com/OpenMage/magento-lts
About my Workplace (simplified version)
https://www.valmano.de/
We sell Watches and Jewelry
About my Workplace (simplified version)
https://www.valmano.de/
We sell Watches and Jewelry
TV series teached me,
Watches are the best anniversary present for long term employees.
Deploying with Git
Great, you are not deploying with FTP/SFTP anymore
● Faster switching between version
● Nearly atomar switch (latency between first and last changed file)
○ Error rate of ~0.3%
● No Fear of on server only “workarounds”
What Error Rate?!!!!
● Request Starts
● Request did load a lot of classes
● Files Change
● Loads another class
● New Class uses method which did not exist in already loaded classes
○ ERROR!!
But OpCache
● Request Starts
● Request did load classes from Opcache
● Files Change
● Loads another class from Opcache
● Loads changed template which did not exist before
● New Template uses method which did not exist in already loaded classes
○ ERROR!!
But OpCache
● Request Starts
● Request did load classes from Opcache
● Files Change
● Loads another class from Opcache
● Loads changed template which did not exist before
● New Template uses method which did not exist in already loaded classes
○ ERROR!!
I forgot the exact case, why this is not covered from opcache, but it still happens
sometimes
How to solve this kind of errors
Prevent files being changed while requests are active in the project folder.
Blue / Green Deployment
Basic Idea is, you have your project twice on the Filesystem
● An active one, and an inactive one
● This can be a symlink which is used as project root
○ If the first file is loaded in magento, most is loaded relative to this file, not to the docroot
● Or full instances of FPM servers
○ which are switched over by a webserver config
● Works also with NodeJS Apps
Take Servers temporary out of loadbalancer
Works only if you have multiple servers
● Take server out of loadbalancer
● Deploy changes
● Put server back in
● Take Next server
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
● Or worse, old Code fails after the DB migration were run.
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
● Or worse, old Code fails after the DB migration were run.
!!!!Maintainance Mode!!!!
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
● Or worse, old Code fails after the DB migration were run.
!!!!Maintainance Mode!!!! Means you failed
Best Practice of DB Migrations
● Make your Code work - always
○ Add proper handling so it still works before the migration is done
○ Try to avoid DB changes, which break old code
■ You should be able to roll back a whole week
■ You should deploy more then once a week
■ If something is terrible broken for a week already, dont roll back, push forward
○ Run DB migrations as last step of deployment
■ Maybe even after a first check if everything still works
Best Practice of DB Migrations
● Make your Code work - always
○ Add proper handling so it still works before the migration is done
○ Try to avoid DB changes, which break old code
■ You should be able to roll back a whole week
■ You should deploy more then once a week
■ If something is terrible broken for a week already, dont roll back, push forward
○ Run DB migrations as last step of deployment
■ Maybe even after a first check if everything still works
● Complain to module vendors if they dont follow best practice
○ Tell them about the additional work it did cause for you
○ But be nice
○ And help them with suggestions
How to measure a deployment
● Time between Triggering and finishing deployment
● Time between a failed deployment and a finished rollback
● Error rate & Downtime
● Average Grade of Fear in the Team doing a deployment on Friday at 17:00
○ And also The Max()
○ Having no Fear and a 2 hour downtime after deployment results in minus points
●
● Time between Triggering and finishing deployment
Not even seconds with git, so why switch?
● Sass
● Babel
● Code Generation
● Composer
● Time between Triggering and finishing deployment
Not even seconds with git, so why switch?
● Sass
● Babel
● Code Generation
● Composer
Because you also have a Build step, which is not covered by Git
● Time between Triggering and finishing deployment
Depends a lot on the Build process
Solution:
● Move the Build process out of the deployment
● Create build artifacts
○ Composer_vendor_$hash.tgz
○ node_modules_$hash.tgz
○ ….
● Add them via single downloads over the local network
● Time between a failed deployment and a finished rollback
In case you have a Blue / Green deployment,
Independent of build process < ~15sec
This is more a risk value, which therefore should be as low as possible.
● Additional health checks during deployment
○ Simulate basic requests
○ Maybe have health check URLs
● Having a CI or Staging setup can help catch problems even before
● Investigate problems afterwards and find automated solutions
○ Never blame the person who hit deploy
● Error rate & Downtime
Fearing deployment
Fear in this case is a good sign for something not working reliable.
While the previous points should help, there is also a human component always.
● People can only manage a certain amount of changes at once
● Trusting a tool is not happening from one day to another
○ Split changes up into smaller parts
○ Spread them over several weeks
○ Involve them in implementing the changes
Build the Composer Vendor artifact
Use the artifact on deploy
There is no one-size-fits-all solution
There are lot of existing solutions
● Capistrano
● Deployer
● Robo
● Ansible
And probably a reason why you dont use one of them already.
The learnings
● Take small steps
● Reducing build time is easier than it seems
○ Build artifacts are just another kind of (permanent) cache
● Make DB migrations harmless
● Simple php scripts are NOT bad practice
Thank You for listening
In case you want to also say Thank you, support me on Patreon.
https://www.patreon.com/Flyingmana
I also take Requests for next Topics I should present about.
Improve the deployment process step by step

More Related Content

What's hot

Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for Scale
Mike Willbanks
 
icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02
Manohar Kumar
 

What's hot (20)

WordPress Local Environments VVV
WordPress Local Environments   VVVWordPress Local Environments   VVV
WordPress Local Environments VVV
 
Why You Should Start Using Docker
Why You Should Start Using DockerWhy You Should Start Using Docker
Why You Should Start Using Docker
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for Scale
 
OpenNTF Essentials
OpenNTF EssentialsOpenNTF Essentials
OpenNTF Essentials
 
Khanh-Nguyen - Gearman - distributed process solution
Khanh-Nguyen - Gearman - distributed process solutionKhanh-Nguyen - Gearman - distributed process solution
Khanh-Nguyen - Gearman - distributed process solution
 
The Continuous Delivery process
The Continuous Delivery processThe Continuous Delivery process
The Continuous Delivery process
 
PuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgPuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard Pijnenburg
 
140 releases per month
140 releases per month140 releases per month
140 releases per month
 
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02
 
From naive to agile - software engineering approach
From naive to agile - software engineering approachFrom naive to agile - software engineering approach
From naive to agile - software engineering approach
 
Distributed Queue System using Gearman
Distributed Queue System using GearmanDistributed Queue System using Gearman
Distributed Queue System using Gearman
 
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
 
open source product management (feat. npm)
open source product management (feat. npm)open source product management (feat. npm)
open source product management (feat. npm)
 
Using Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development TeamUsing Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development Team
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
 
Felt - Front end load testing
Felt - Front end load testingFelt - Front end load testing
Felt - Front end load testing
 
Gearman
GearmanGearman
Gearman
 

Similar to Improve the deployment process step by step

Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
smithmilner
 

Similar to Improve the deployment process step by step (20)

Devops, the future is here, it's just not evenly distributed yet.
Devops, the future is here, it's just not evenly distributed yet.Devops, the future is here, it's just not evenly distributed yet.
Devops, the future is here, it's just not evenly distributed yet.
 
Devops at Startup Weekend BXL
Devops at Startup Weekend BXLDevops at Startup Weekend BXL
Devops at Startup Weekend BXL
 
Monitoring and automation
Monitoring and automationMonitoring and automation
Monitoring and automation
 
Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
 
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous Deployment
 
Devops For Drupal
Devops  For DrupalDevops  For Drupal
Devops For Drupal
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)
 
Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?
 
Continuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageContinuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritage
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
Instant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetInstant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and Puppet
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusion
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
 
The Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security TestingThe Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security Testing
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Mulesoft Meetup Milano #9 - Batch Processing and CI/CD
Mulesoft Meetup Milano #9 - Batch Processing and CI/CDMulesoft Meetup Milano #9 - Batch Processing and CI/CD
Mulesoft Meetup Milano #9 - Batch Processing and CI/CD
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?
 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Recently uploaded (20)

Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 

Improve the deployment process step by step

  • 1. Improving the deployment Process Step by Step
  • 2. About me Daniel Fahlke (aka Flyingmana) ● Working as a Software Engineer with Magento and PHP ● Doing lots of open Source ● Helps maintaining the OpenMage-LTS Fork ● http://flyingmana.name/ ● https://github.com/Flyingmana ● https://twitter.com/Flyingmana ● https://www.patreon.com/Flyingmana ● https://github.com/OpenMage/magento-lts
  • 3. About my Workplace (simplified version) https://www.valmano.de/ We sell Watches and Jewelry
  • 4. About my Workplace (simplified version) https://www.valmano.de/ We sell Watches and Jewelry TV series teached me, Watches are the best anniversary present for long term employees.
  • 5. Deploying with Git Great, you are not deploying with FTP/SFTP anymore ● Faster switching between version ● Nearly atomar switch (latency between first and last changed file) ○ Error rate of ~0.3% ● No Fear of on server only “workarounds”
  • 6. What Error Rate?!!!! ● Request Starts ● Request did load a lot of classes ● Files Change ● Loads another class ● New Class uses method which did not exist in already loaded classes ○ ERROR!!
  • 7. But OpCache ● Request Starts ● Request did load classes from Opcache ● Files Change ● Loads another class from Opcache ● Loads changed template which did not exist before ● New Template uses method which did not exist in already loaded classes ○ ERROR!!
  • 8. But OpCache ● Request Starts ● Request did load classes from Opcache ● Files Change ● Loads another class from Opcache ● Loads changed template which did not exist before ● New Template uses method which did not exist in already loaded classes ○ ERROR!! I forgot the exact case, why this is not covered from opcache, but it still happens sometimes
  • 9. How to solve this kind of errors Prevent files being changed while requests are active in the project folder.
  • 10. Blue / Green Deployment Basic Idea is, you have your project twice on the Filesystem ● An active one, and an inactive one ● This can be a symlink which is used as project root ○ If the first file is loaded in magento, most is loaded relative to this file, not to the docroot ● Or full instances of FPM servers ○ which are switched over by a webserver config ● Works also with NodeJS Apps
  • 11. Take Servers temporary out of loadbalancer Works only if you have multiple servers ● Take server out of loadbalancer ● Deploy changes ● Put server back in ● Take Next server
  • 12. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations
  • 13. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations ● Or worse, old Code fails after the DB migration were run.
  • 14. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations ● Or worse, old Code fails after the DB migration were run. !!!!Maintainance Mode!!!!
  • 15. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations ● Or worse, old Code fails after the DB migration were run. !!!!Maintainance Mode!!!! Means you failed
  • 16. Best Practice of DB Migrations ● Make your Code work - always ○ Add proper handling so it still works before the migration is done ○ Try to avoid DB changes, which break old code ■ You should be able to roll back a whole week ■ You should deploy more then once a week ■ If something is terrible broken for a week already, dont roll back, push forward ○ Run DB migrations as last step of deployment ■ Maybe even after a first check if everything still works
  • 17. Best Practice of DB Migrations ● Make your Code work - always ○ Add proper handling so it still works before the migration is done ○ Try to avoid DB changes, which break old code ■ You should be able to roll back a whole week ■ You should deploy more then once a week ■ If something is terrible broken for a week already, dont roll back, push forward ○ Run DB migrations as last step of deployment ■ Maybe even after a first check if everything still works ● Complain to module vendors if they dont follow best practice ○ Tell them about the additional work it did cause for you ○ But be nice ○ And help them with suggestions
  • 18. How to measure a deployment ● Time between Triggering and finishing deployment ● Time between a failed deployment and a finished rollback ● Error rate & Downtime ● Average Grade of Fear in the Team doing a deployment on Friday at 17:00 ○ And also The Max() ○ Having no Fear and a 2 hour downtime after deployment results in minus points ●
  • 19. ● Time between Triggering and finishing deployment Not even seconds with git, so why switch? ● Sass ● Babel ● Code Generation ● Composer
  • 20. ● Time between Triggering and finishing deployment Not even seconds with git, so why switch? ● Sass ● Babel ● Code Generation ● Composer Because you also have a Build step, which is not covered by Git
  • 21. ● Time between Triggering and finishing deployment Depends a lot on the Build process Solution: ● Move the Build process out of the deployment ● Create build artifacts ○ Composer_vendor_$hash.tgz ○ node_modules_$hash.tgz ○ …. ● Add them via single downloads over the local network
  • 22. ● Time between a failed deployment and a finished rollback In case you have a Blue / Green deployment, Independent of build process < ~15sec
  • 23. This is more a risk value, which therefore should be as low as possible. ● Additional health checks during deployment ○ Simulate basic requests ○ Maybe have health check URLs ● Having a CI or Staging setup can help catch problems even before ● Investigate problems afterwards and find automated solutions ○ Never blame the person who hit deploy ● Error rate & Downtime
  • 24. Fearing deployment Fear in this case is a good sign for something not working reliable. While the previous points should help, there is also a human component always. ● People can only manage a certain amount of changes at once ● Trusting a tool is not happening from one day to another ○ Split changes up into smaller parts ○ Spread them over several weeks ○ Involve them in implementing the changes
  • 25. Build the Composer Vendor artifact
  • 26. Use the artifact on deploy
  • 27. There is no one-size-fits-all solution There are lot of existing solutions ● Capistrano ● Deployer ● Robo ● Ansible And probably a reason why you dont use one of them already.
  • 28. The learnings ● Take small steps ● Reducing build time is easier than it seems ○ Build artifacts are just another kind of (permanent) cache ● Make DB migrations harmless ● Simple php scripts are NOT bad practice
  • 29. Thank You for listening In case you want to also say Thank you, support me on Patreon. https://www.patreon.com/Flyingmana I also take Requests for next Topics I should present about.