Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Automating Deployments with Deployer - php[world] 2018

39 visualizaciones

Publicado el

Have you ever botched a deployment and taken a site offline? I have - more times then I'd like to admit. What if we could completely automate the deployment process, make it lightning fast, remove most of the risk, and do it all without custom bash scripts? Better yet, what if we could use the same exact deployment process locally or trigger it via CI? All of this is possible with Deployer - a PHP-based deployment tool which supports virtually every CMS and framework! Attendees will learn the basics of Deployer, how to customize deployments to fit their needs, and how to handle situations if things go wrong.

Publicado en: Software
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Automating Deployments with Deployer - php[world] 2018

  1. 1. Automating Deployments with Deployer @colinodell
  2. 2. @colinodell Colin O'Dell Lead Developer & DevOps Engineer Unleashed Technologies
  3. 3. @colinodell Frequent Deployments: • New Initiatives • Ongoing Growth & Maintenance • In-House Development Hassle-Free Deployments: • Automated • Repeatable / Reliable • Minimal Downtime • Standardized • Executable by anyone
  4. 4. @colinodell FTP / vim @colinodell
  5. 5. @colinodell git pull @colinodell
  6. 6. @colinodell bash script @colinodell
  7. 7. @colinodell bash script @colinodell
  8. 8. @colinodell bash script @colinodell
  9. 9. @colinodell capistrano
  10. 10. @colinodell capistrano
  11. 11. @colinodell docker @colinodell
  12. 12. @colinodell also docker
  13. 13. @colinodell ✔️ deployer
  14. 14. @colinodell Overview • Deployment Methodology • Getting Started • Recipes • Configuration • Hosts • Tasks • Customizations • Q&A
  15. 15. @colinodell Deployment Methodology How Deployer Works Under-The-Hood
  16. 16. @colinodell webroot
  17. 17. @colinodell releases 1 current“web root”
  18. 18. @colinodell releases 1 2 current“web root”
  19. 19. @colinodell releases 1 2 current“web root”
  20. 20. @colinodell releases 1 2 current“web root”
  21. 21. @colinodell releases 1 current releases 1 current
  22. 22. @colinodell releases 1 2 current releases 1 2 current
  23. 23. @colinodell releases 1 2 current releases 1 2 current
  24. 24. @colinodell releases 1 2 current releases 1 2 current
  25. 25. @colinodell releases 1 2 current releases 1 2 current releases 1 2 current releases 1 2 current releases 1 2 current releases 1 2 current releases 1 2 current releases 1 2 current
  26. 26. @colinodell releases 1 current shared
  27. 27. @colinodell releases 1 current web settings.php shared uploads
  28. 28. @colinodell releases 1 current web settings.php shared uploads uploads settings.php src web index.php 1
  29. 29. @colinodell releases 1 current web settings.php shared uploads uploads settings.php src web index.php 1 22
  30. 30. @colinodell releases 1 current web settings.php shared uploads uploads settings.php src web index.php 1 src web index.php 22
  31. 31. @colinodell releases 1 current web settings.php shared uploads uploads settings.php src web index.php 1 uploads settings.php src web index.php 22
  32. 32. @colinodell releases 1 current web settings.php shared uploads uploads settings.php src web index.php 1 uploads settings.php src web index.php 22
  33. 33. @colinodell releases 1 current web settings.php shared uploads 2 Shared Filesystem (NFS) releases 1 current 2
  34. 34. @colinodell Getting Started
  35. 35. @colinodell Installation Install .phar globally: Via Composer (.phar): Via Composer (source): Good for developing recipe Better once completed
  36. 36. @colinodell Initializing Deployer
  37. 37. @colinodell deploy.php
  38. 38. @colinodell
  39. 39. @colinodell “Recipes” (aka deployment script) • Configuration • Deployment settings • Hosts • Where does this deploy to • Tasks • What commands and tasks need to run
  40. 40. @colinodell Configuration • Key-value store • Settings referenced in tasks
  41. 41. @colinodell has() set() get()
  42. 42. @colinodell has() set() get() add()
  43. 43. @colinodell Hosts Define in deploy.php or separate YML file
  44. 44. @colinodell Host Connection Settings
  45. 45. @colinodell Multiple Hosts & Environments
  46. 46. @colinodell Multiple Hosts & Roles
  47. 47. @colinodell Flow
  48. 48. @colinodell
  49. 49. @colinodell
  50. 50. @colinodell releases shared .dep
  51. 51. @colinodell releases shared .dep deploy.lock
  52. 52. @colinodell releases shared .dep deploy.lock 1 1
  53. 53. @colinodell releases shared .dep deploy.lock 1 1 src web index.php composer.json
  54. 54. @colinodell releases shared .dep deploy.lock 1 src web index.php 1 uploads settings.php composer.json
  55. 55. @colinodell releases shared .dep deploy.lock 1 src web index.php 1 uploads settings.php composer.json
  56. 56. @colinodell releases shared .dep deploy.lock 1 src web index.php 1 uploads settings.php composer.json vendor
  57. 57. @colinodell releases shared .dep deploy.lock 1 src web index.php 1 uploads settings.php composer.json vendor
  58. 58. @colinodell releases shared .dep deploy.lock 1 src web index.php 1 uploads settings.php composer.json vendor current
  59. 59. @colinodell releases shared .dep deploy.lock 1 src web index.php 1 uploads settings.php composer.json vendor current
  60. 60. @colinodell releases shared .dep 1 src web index.php 1 uploads settings.php composer.json vendor current
  61. 61. @colinodell releases shared .dep 1 src web index.php 1 uploads settings.php composer.json vendor current
  62. 62. @colinodell
  63. 63. @colinodell Making Deployments
  64. 64. @colinodell Making Verbose Deployments
  65. 65. @colinodell Making Very Verbose Deployments
  66. 66. @colinodell Making Very Very Verbose Deployments
  67. 67. @colinodell Making Very Very Verbose Deployments
  68. 68. @colinodell Making Very Very Verbose Deployments
  69. 69. @colinodell Default Task Execution Host 1 Task 1 Host 2 Host 3 Task 1 Task 1 Task 2 Task 2 Task 2 Host 4 Task 1 Task 2
  70. 70. @colinodell Parallel Task Execution: --parallel Host 1 Task 1 Host 2 Host 3 Task 1 Task 1 Task 2 Task 2 Task 2 Host 4 Task 1 Task 2 Task 3 Task 3 Task 3 Task 3
  71. 71. @colinodell Parallel Task Execution: --parallel --limit=2 Host 1 Task 1 Host 2 Host 3 Task 1 Task 2 Task 2 Task 1 Host 4 Task 1 Task 2 Task 2
  72. 72. @colinodell Other Commands
  73. 73. @colinodell Other Recipes
  74. 74. @colinodell Other Recipes: WordPress
  75. 75. @colinodell Other Recipes: Laravel
  76. 76. @colinodell Other Recipes: Laravel
  77. 77. @colinodell Customization Defining custom tasks & recipes
  78. 78. @colinodell Custom Tasks
  79. 79. @colinodell Custom Tasks
  80. 80. @colinodell Custom Tasks
  81. 81. @colinodell Custom Tasks
  82. 82. @colinodell Custom Tasks
  83. 83. @colinodell Custom Tasks
  84. 84. @colinodell Custom Tasks
  85. 85. @colinodell Custom Tasks
  86. 86. @colinodell
  87. 87. @colinodell Custom Tasks
  88. 88. @colinodell Questions?
  89. 89. Feedback Appreciated! https://joind.in/talk/e3775 Learn More about Deployer: https://deployer.org/docs Slides: Twitter: @colinodell

×