Best Practices for CD
with Drupal
Renato Vasconcellos
renato@taller.net.br
What you’re about to
see in this
presentation?
● What’s Continuous Deployment
● Tools & Modules
● Development Workflow
● Tips & Resources
Agenda
Disclaimer
This presentation aims those people who are
willing to start or to get lessons learned with
Continuous Deployment.
If you’re used to the devops principles and
you’re an advanced Drupal developer maybe
you already know what is coming next.
What means Deploy?
“Placement of
equipment and troops
in a battlefield.”
www.webopedia.com/TERM/D/deploy.html
“To install, test and
implement an
application or computer
system.”
www.webopedia.com/TERM/D/deploy.htm
Continuous Integration?
Continuous Delivery?
Continuous
Deployment?
Continuous Integration
To integrate your work
constantly with your
team members.
Continuous Delivery
Provide your work
constantly for review
by the team or client.
Continuous
Deployment
Deploy your work
constantly into
client’s server.
Continuous Deployment
is a reflex the team’s
culture and discipline.
Continuous
Deployment
in 5 steps
Eric Ries - O'Reilly Radar
http://lb.cm/dploy5stps
CI Server
(Continuous Integration server)
Source control
commit check
Simple
deployment
scripts
Real-time
alerting
Root cause
analysis
(the five whys)
Where/how to start?
Image by Jalel
Standardized
Workflow
Work Agreements
WAs are the set of
rules/disciplines/processes the
team agrees to follow without fail
to make themselves more efficient
and successful.
Vignesh Murthy
https://www.scrumalliance.org/community/articles/2014/january/work-agreements-scrum-
team
Coding Standards
drupal.org/coding-standards
Everything in Code
Test Driven
Development
CI/CD Server
Make your choice
● Jenkins
● CircleCI
● Codeship
● Strider CD
● Dploy
● Travis CI
● Go
● Other
Deploy on Green!
Development
Workflow
Pipeline
Develop.
Test/QA
Productio
n
UAT/Stagin
g
Development
Environment
Development environment
should resemble the
production environment.
Test/QA
Environment
QA environment
should resemble the
production environment.
UAT/Staging/Pre-prod
Environment
UAT environment
must resemble the
production environment.
Production
Environment
Recap.
Develop.
Test/QA
http://dltj.org/article/software-development-practice/
http://spacebug.com/effective_development_environments/
Productio
n
UAT/Stagin
g
What about Drupal?
Drupal Development
Virtual Machine
drupal.org/project/vm
github.com/zivtech/vagrant-development-vm
github.com/geerlingguy/drupal-dev-vm
github.com/sebas5384/charm-drupal
Drush
drush.org
Install Profiles /
Custom Distributions
drupal.org/documentation/build/distributions
Strongarm Module
drupal.org/project/strongarm
Features Module
drupal.org/project/features
drupal.org/documentation/modules/features
Default Config Module
drupal.org/project/defaultconfig
Custom
Deployment Module
befused.com/drupal/site-deployment-module
Configuration Management
Module
drupal.org/project/configuration
UUID Module
drupal.org/project/uuid
Deploy Module
drupal.org/project/deploy
WF Tools Module
drupal.org/project/wf_tools
Git Workflow
atlassian.com/git/workflows
Centralized
workflow
Feature branch
workflow
Git flow
workflow
Forking
workflow
A successful
git branch model?
Vincent Driessen
nvie.com/posts/a-successful-git-branching-model
Git flow
Workflow
Git flow
https://github.com/nvie/gitflow
Git flow cheat sheet
http://danielkummer.github.io/git-flow-cheatsheet/
.git/Hooks
git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Client Side
Pre
Commit
● Coding Standards (Lint)
● Automated tests
Post
Checkout
● Automated tests
● Broken branch check
Server Side
Pre
Receive
● Coding Standards (Lint)
● Automated tests
● Branch protection
Post
Receive
● Load tests
● Notifications
What about Drupal?
Coder Module
drupal.org/project/coder
PAReview script
drupal.org/project/pareviewsh
Drupal Code Quality
Module
drupal.org/project/dcq
Automated Tests
Automated Tests brings
security and reliability
to a continual
improvement process.
Joseph Yodel
slideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012
Joseph Yodel
slideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012
Joseph Yodel
slideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012
What about Drupal?
Simple Test
drupal.org/project/simpletest
PHP Unit
phpunit.de
drupal.org/phpunit
Behat Extension
Module
drupal.org/project/drupalextension
Barbor
(BDD Framework)
github.com/barbor/barbor
Questions & Answers
Give your feedback!
latinamerica2015.drupal.org/session/best-practices-continuous-deployment-
drupal
Let’s talk!
@revagomes
renato@taller.net.br
drupal.org/u/revagomes
about.me/revagomes

Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015