SlideShare a Scribd company logo
DEPLOYER
DEPLOYER.ORG - DEPLOYMENT TOOL FOR PHP
HERNÂNI BORGES DE FREITAS
PHPLX NOVEMBER 2017
ME
-  Long time PHP user ~ early 2000
-  Drupal Expert / Former Acquia
-  Freelance Architect and Developer
-  Addicted to good hobbies – SerBenfiquista.com
Hernani.pt / twitter: hernanibf
DEPLOYMENT
1.  Build release artifact
2.  Identify to which environment you want to deploy (dev,
staging , prod).
3.  Ideally you save a backup of previous application state in
that environment so you can rollback.
4.  Copy artifact to servers
5.  Execute upgrade procedures (clear cache, update
database schemas, configure services, send
notifications ).
6.  Application live
“Software deployment is all of the activities that make a software system
available for use.”
Deployer - Deployment tool for PHP
PROBLEMS
•  Deployments/releases can take 10% of overall project time
•  Downtime involved
•  Not automatized? Human errors ready to happen
•  Hard to rollback in failures
•  Complexity increase with number of web nodes,
environments and their difference
WHAT’S TYPICAL
•  Copy code to servers
•  (FTP, RSYNC, etc..)
•  Deploy from source control
•  Git pull, svn checkout
•  Deploying using other tools / platforms
•  Capistrano, Envoyer/Forge, platform tools..
PERFECT WORLD
•  Code is controlled in
a repository
•  Code is deployed
directly from a
branch or tag.
•  Deployment is done
AUTOMATICALLY to
any environment
from a central
location
•  No human errors,
easy to rollback,
minimum deployment
time and downtime.
MEET DEPLOYER
-  PHP package that allows the configuration and execution
of deployments (deployer.org). Started in 2013 by Anton
Medvedev.
-  All deployment configuration defined as a recipe in a
single file (deploy.php)
-  Define Git origin repository
-  Define environments and their hosts
-  Define deployer strategy
-  Define tasks to be executed in different deployment stages
-  Atomic deployment
-  All tasks related with deployment in a single atomic step
-  Maintains consistency across all servers
-  Rollback possible
GOOD FRIENDSHIPS
INSTALLATION
Or with composer
SIMPLE CONFIGURATION
<?php
namespace Deployer;
require' recipe/drupal8.php' ;
set(' repository' ,' git@bitbucket.org:yourorg/yourepo.git' );
host(' web1.example.com' )
->stage(' production' )
->set(' deploy_path' ,' /home/user/site_prod' );
host(' web2.example.com' )
->stage(' production' )
->set(' deploy_path' ,' /home/user/site_prod' );
host(' web3.example.com' )
->stage(' development' )
->set(' deploy_path' ,' /home/user/site_dev' );
Deploy.php
OTHER FEATURES
-  Shared folders
set('shared_dirs', [
'docroot/sites/{{drupal_site}}/files',
'docroot/forum/attachments',
'docroot/forum/avatars',
'docroot/forum/avatars_custom',
]);
-  Writable dirs
set(' writable_dirs' , [ ' docroot/sites/{{drupal_site}}/files’]);
-  Shared files
TYPICAL RECIPE
task(' deploy' , [
' deploy:prepare' ,
' deploy:lock' ,
' deploy:release' ,
' deploy:update_code' ,
' deploy:shared' ,
' deploy:symlink' ,
' deploy:unlock' ,
' cleanup' 
]);
EXECUTION
$ php dep deploy production --branch=master
-  Code is copied to this structure
-  Permissions are set correctly, shared folders are setup
-  Symlink is defined correctly after code is deployed on all servers
-  Update functions are run if defined
-  https://deployer.org/docs/flow
MISC
-  Different strategies to build/deploy:
-  Deployer checking out code on all servers from git
repository
-  Deployer builiding the artifact on a build server and
syncing to all hosts
-  Parallellism
-  Recipes in
https://github.com/deployphp/deployer/tree/master/recipe
-  Custom tasks definition to define in your recipe
task(' build' ,'
composer install
npm install
npm run build
...
');
-  Largest European event for Drupal developers
-  Lisbon - https://lisbon2018.drupaldays.org/
-  July 2nd – July 6th - Iscte
-  Full week of Drupal and open source talks and sprints! Tickets coming soon .
DRUPAL DEV DAYS 2018
Or share your alternative or experience?
Or walk straight to dinner?
QUESTIONS?

More Related Content

What's hot (20)

PDF
My Site is slow - Drupal Camp London 2013
hernanibf
 
PDF
Acquia Commons
hernanibf
 
PDF
Drupal 8 - A Brief Introduction
Jeff Geerling
 
PPTX
Top 8 Improvements in Drupal 8
Angela Byron
 
PPT
Drupal - Introduction to Building Library Web Site Using Drupal
Vibrant Technologies & Computers
 
KEY
Introduction to Drupal
sdmaxey
 
PDF
WordPress as a CMS - Case Study of an Organizational Intranet
Tech Liminal
 
PDF
Introduction to Drupal Basics
Juha Niemi
 
PDF
Phase2 Large Drupal Multisites (gta case study)
Phase2
 
PDF
Everything You Need to Know About the Top Changes in Drupal 8
Acquia
 
ODP
Beginners Guide to Drupal
Gerald Villorente
 
PDF
Introduction to the Drupal - Web Experience Toolkit
Suzanne Dergacheva
 
ODP
Drupal 7x Installation - Introduction to Drupal Concepts
Micky Metts
 
PPT
Drupal - Introduction to Drupal and Web Content Management
Vibrant Technologies & Computers
 
PPTX
Top 20 mistakes you will make on your 1st Drupal project
Iztok Smolic
 
PDF
10 New Things You Can Do with Drupal 8 Out-of-the-Box
Suzanne Dergacheva
 
PPTX
72d5drupal
Mahesh Sherkar
 
PDF
Site Building Checklist DrupalCamp Ottawa
Suzanne Dergacheva
 
PDF
Evolution of Drupal and the Drupal community
Angela Byron
 
My Site is slow - Drupal Camp London 2013
hernanibf
 
Acquia Commons
hernanibf
 
Drupal 8 - A Brief Introduction
Jeff Geerling
 
Top 8 Improvements in Drupal 8
Angela Byron
 
Drupal - Introduction to Building Library Web Site Using Drupal
Vibrant Technologies & Computers
 
Introduction to Drupal
sdmaxey
 
WordPress as a CMS - Case Study of an Organizational Intranet
Tech Liminal
 
Introduction to Drupal Basics
Juha Niemi
 
Phase2 Large Drupal Multisites (gta case study)
Phase2
 
Everything You Need to Know About the Top Changes in Drupal 8
Acquia
 
Beginners Guide to Drupal
Gerald Villorente
 
Introduction to the Drupal - Web Experience Toolkit
Suzanne Dergacheva
 
Drupal 7x Installation - Introduction to Drupal Concepts
Micky Metts
 
Drupal - Introduction to Drupal and Web Content Management
Vibrant Technologies & Computers
 
Top 20 mistakes you will make on your 1st Drupal project
Iztok Smolic
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
Suzanne Dergacheva
 
72d5drupal
Mahesh Sherkar
 
Site Building Checklist DrupalCamp Ottawa
Suzanne Dergacheva
 
Evolution of Drupal and the Drupal community
Angela Byron
 

Similar to Deployer - Deployment tool for PHP (20)

PDF
Rock Solid Deployment of Web Applications
Pablo Godel
 
PDF
Deployer
Michael Trestianu
 
PDF
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
PPTX
drupal ci cd concept cornel univercity.pptx
rukuntravel
 
PDF
Deploying Symfony | symfony.cat
Pablo Godel
 
PDF
High Stakes Continuous Delivery in the Real World #OpenWest
Joshua Warren
 
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
PDF
Manage and Deploy your sites with Drush
Amazee Labs
 
PDF
Evolution of deploy.sh
Leonid Mamchenkov
 
PDF
Write php deploy everywhere tek11
Michelangelo van Dam
 
PDF
Continuous Integration and Deployment Patterns for Magento
AOE
 
PDF
Rock-solid Magento Development and Deployment Workflows
AOE
 
PDF
Automated deployment
Sardorbek Muminov
 
PDF
Stress Free Deployment - Confoo 2011
Bachkoutou Toutou
 
PDF
DevOps: Cooking Drupal Deployment
Gerald Villorente
 
PDF
One commit, one release. Continuously delivering a Symfony project.
Javier López
 
PDF
DERP: Free Rosas
Free Rosas
 
PDF
Build & deploy PHP application (intro level)
Anton Babenko
 
PDF
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
Pablo Godel
 
Rock Solid Deployment of Web Applications
Pablo Godel
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
drupal ci cd concept cornel univercity.pptx
rukuntravel
 
Deploying Symfony | symfony.cat
Pablo Godel
 
High Stakes Continuous Delivery in the Real World #OpenWest
Joshua Warren
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Manage and Deploy your sites with Drush
Amazee Labs
 
Evolution of deploy.sh
Leonid Mamchenkov
 
Write php deploy everywhere tek11
Michelangelo van Dam
 
Continuous Integration and Deployment Patterns for Magento
AOE
 
Rock-solid Magento Development and Deployment Workflows
AOE
 
Automated deployment
Sardorbek Muminov
 
Stress Free Deployment - Confoo 2011
Bachkoutou Toutou
 
DevOps: Cooking Drupal Deployment
Gerald Villorente
 
One commit, one release. Continuously delivering a Symfony project.
Javier López
 
DERP: Free Rosas
Free Rosas
 
Build & deploy PHP application (intro level)
Anton Babenko
 
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
Pablo Godel
 
Ad

More from hernanibf (6)

PDF
Drupal Europe 2018: Hackers automate but the drupal community still downloads...
hernanibf
 
PPTX
Aiming for automatic updates - Drupal Dev Days Lisbon 2018
hernanibf
 
PDF
Fix me if you can - DrupalCon prague
hernanibf
 
PPT
Drupal Performance - SerBenfiquista.com Case Study
hernanibf
 
PDF
Drupal + selenium
hernanibf
 
PDF
Drupal Recipe
hernanibf
 
Drupal Europe 2018: Hackers automate but the drupal community still downloads...
hernanibf
 
Aiming for automatic updates - Drupal Dev Days Lisbon 2018
hernanibf
 
Fix me if you can - DrupalCon prague
hernanibf
 
Drupal Performance - SerBenfiquista.com Case Study
hernanibf
 
Drupal + selenium
hernanibf
 
Drupal Recipe
hernanibf
 
Ad

Recently uploaded (20)

PDF
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PPTX
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
sajflsajfljsdfljslfjslfsdfas;fdsfksadfjlsdflkjslgfs;lfjlsajfl;sajfasfd.pptx
theknightme
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PPTX
internet básico presentacion es una red global
70965857
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PPT
introductio to computers by arthur janry
RamananMuthukrishnan
 
PDF
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PDF
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
PPTX
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
Orchestrating things in Angular application
Peter Abraham
 
sajflsajfljsdfljslfjslfsdfas;fdsfksadfjlsdflkjslgfs;lfjlsajfl;sajfasfd.pptx
theknightme
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
internet básico presentacion es una red global
70965857
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
introductio to computers by arthur janry
RamananMuthukrishnan
 
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 

Deployer - Deployment tool for PHP

  • 1. DEPLOYER DEPLOYER.ORG - DEPLOYMENT TOOL FOR PHP HERNÂNI BORGES DE FREITAS PHPLX NOVEMBER 2017
  • 2. ME -  Long time PHP user ~ early 2000 -  Drupal Expert / Former Acquia -  Freelance Architect and Developer -  Addicted to good hobbies – SerBenfiquista.com Hernani.pt / twitter: hernanibf
  • 3. DEPLOYMENT 1.  Build release artifact 2.  Identify to which environment you want to deploy (dev, staging , prod). 3.  Ideally you save a backup of previous application state in that environment so you can rollback. 4.  Copy artifact to servers 5.  Execute upgrade procedures (clear cache, update database schemas, configure services, send notifications ). 6.  Application live “Software deployment is all of the activities that make a software system available for use.”
  • 5. PROBLEMS •  Deployments/releases can take 10% of overall project time •  Downtime involved •  Not automatized? Human errors ready to happen •  Hard to rollback in failures •  Complexity increase with number of web nodes, environments and their difference
  • 6. WHAT’S TYPICAL •  Copy code to servers •  (FTP, RSYNC, etc..) •  Deploy from source control •  Git pull, svn checkout •  Deploying using other tools / platforms •  Capistrano, Envoyer/Forge, platform tools..
  • 7. PERFECT WORLD •  Code is controlled in a repository •  Code is deployed directly from a branch or tag. •  Deployment is done AUTOMATICALLY to any environment from a central location •  No human errors, easy to rollback, minimum deployment time and downtime.
  • 8. MEET DEPLOYER -  PHP package that allows the configuration and execution of deployments (deployer.org). Started in 2013 by Anton Medvedev. -  All deployment configuration defined as a recipe in a single file (deploy.php) -  Define Git origin repository -  Define environments and their hosts -  Define deployer strategy -  Define tasks to be executed in different deployment stages -  Atomic deployment -  All tasks related with deployment in a single atomic step -  Maintains consistency across all servers -  Rollback possible
  • 11. SIMPLE CONFIGURATION <?php namespace Deployer; require' recipe/drupal8.php' ; set(' repository' ,' [email protected]:yourorg/yourepo.git' ); host(' web1.example.com' ) ->stage(' production' ) ->set(' deploy_path' ,' /home/user/site_prod' ); host(' web2.example.com' ) ->stage(' production' ) ->set(' deploy_path' ,' /home/user/site_prod' ); host(' web3.example.com' ) ->stage(' development' ) ->set(' deploy_path' ,' /home/user/site_dev' ); Deploy.php
  • 12. OTHER FEATURES -  Shared folders set('shared_dirs', [ 'docroot/sites/{{drupal_site}}/files', 'docroot/forum/attachments', 'docroot/forum/avatars', 'docroot/forum/avatars_custom', ]); -  Writable dirs set(' writable_dirs' , [ ' docroot/sites/{{drupal_site}}/files’]); -  Shared files
  • 13. TYPICAL RECIPE task(' deploy' , [ ' deploy:prepare' , ' deploy:lock' , ' deploy:release' , ' deploy:update_code' , ' deploy:shared' , ' deploy:symlink' , ' deploy:unlock' , ' cleanup' ]);
  • 14. EXECUTION $ php dep deploy production --branch=master -  Code is copied to this structure -  Permissions are set correctly, shared folders are setup -  Symlink is defined correctly after code is deployed on all servers -  Update functions are run if defined -  https://deployer.org/docs/flow
  • 15. MISC -  Different strategies to build/deploy: -  Deployer checking out code on all servers from git repository -  Deployer builiding the artifact on a build server and syncing to all hosts -  Parallellism -  Recipes in https://github.com/deployphp/deployer/tree/master/recipe -  Custom tasks definition to define in your recipe task(' build' ,' composer install npm install npm run build ... ');
  • 16. -  Largest European event for Drupal developers -  Lisbon - https://lisbon2018.drupaldays.org/ -  July 2nd – July 6th - Iscte -  Full week of Drupal and open source talks and sprints! Tickets coming soon . DRUPAL DEV DAYS 2018
  • 17. Or share your alternative or experience? Or walk straight to dinner? QUESTIONS?