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.”
4.
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
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?