Page 1
Best Practices for CDwith Drupal
Renato Vasconcellos
[email protected]
Page 2
What you’re about to
see in this
presentation?
Page 3
● What’s Continuous Deployment
● Tools & Modules
● Development Workflow
● Tips & Resources
Agenda
Page 4
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.
Page 5
What means Deploy?
Page 6
“Placement of
equipment and troops
in a battlefield.”
www.webopedia.com/TERM/D/deploy.html
Page 7
“To install, test and
implement an
application or computer
system.”www.webopedia.com/TERM/D/deploy.htm
Page 8
Continuous Integration?
Continuous Delivery?
Continuous
Deployment?
Page 9
Continuous Integration
Page 10
To integrate your work
constantly with your
team members.
Page 11
Continuous Delivery
Page 12
Provide your work
constantly for review
by the team or client.
Page 13
Continuous
Deployment
Page 14
Deploy your work
constantly into
client’s server.
Page 15
Continuous Deployment
is a reflex the team’s
culture and discipline.
Page 16
Continuous
Deployment
in 5 steps
Eric Ries - O'Reilly Radar
http://lb.cm/dploy5stps
Page 17
CI Server(Continuous Integration server)
Page 18
Source control
commit check
Page 19
Simple
deployment
scripts
Page 20
Real-time
alerting
Page 21
Root cause
analysis(the five whys)
Page 22
Where/how to start?
Image by Jalel
Page 23
Standardized
Workflow
Page 25
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
Page 26
Coding Standards
drupal.org/coding-standards
Page 27
Everything in Code
Page 28
Test Driven
Development
Page 30
Make your choice
● Jenkins
● CircleCI
● Codeship
● Strider CD
● Dploy
● Travis CI
● Go
● Other
Page 32
Development
Workflow
Page 33
Pipeline
Develop.
Test/QA
Productio
n
UAT/Stagin
g
Page 34
Development
Environment
Page 35
Development environment
should resemble the
production environment.
Page 36
Test/QA
Environment
Page 37
QA environment
should resemble the
production environment.
Page 38
UAT/Staging/Pre-prod
Environment
Page 39
UAT environment
must resemble the
production environment.
Page 40
Production
Environment
Page 41
Recap.
Develop.
Test/QA
http://dltj.org/article/software-development-practice/
http://spacebug.com/effective_development_environments/
Productio
n
UAT/Stagin
g
Page 42
What about Drupal?
Page 43
Drupal Development
Virtual Machinedrupal.org/project/vm
github.com/zivtech/vagrant-development-vm
github.com/geerlingguy/drupal-dev-vm
github.com/sebas5384/charm-drupal
Page 45
Install Profiles /
Custom Distributions
drupal.org/documentation/build/distributions
Page 46
Strongarm Moduledrupal.org/project/strongarm
Page 47
Features Moduledrupal.org/project/features
drupal.org/documentation/modules/features
Page 48
Default Config Moduledrupal.org/project/defaultconfig
Page 49
Custom
Deployment Modulebefused.com/drupal/site-deployment-module
Page 50
Configuration Management
Moduledrupal.org/project/configuration
Page 51
UUID Moduledrupal.org/project/uuid
Page 52
Deploy Moduledrupal.org/project/deploy
Page 53
WF Tools Moduledrupal.org/project/wf_tools
Page 55
Git Workflow
atlassian.com/git/workflows
Page 56
Centralized
workflow
Page 57
Feature branch
workflow
Page 58
Git flow
workflow
Page 60
A successful
git branch model?
Vincent Driessennvie.com/posts/a-successful-git-branching-model
Page 61
Git flow
Workflow
Git flowhttps://github.com/nvie/gitflow
Git flow cheat sheethttp://danielkummer.github.io/git-flow-cheatsheet/
Page 62
.git/Hooks
git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Page 64
Pre
Commit
● Coding Standards (Lint)
● Automated tests
Page 65
Post
Checkout
● Automated tests
● Broken branch check
Page 67
Pre
Receive
● Coding Standards (Lint)
● Automated tests
● Branch protection
Page 68
Post
Receive
● Load tests
● Notifications
Page 69
What about Drupal?
Page 70
Coder Module
drupal.org/project/coder
Page 71
PAReview script
drupal.org/project/pareviewsh
Page 72
Drupal Code Quality
Moduledrupal.org/project/dcq
Page 74
Automated Tests brings
security and reliability
to a continual
improvement process.
Page 75
Joseph Yodelslideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012
Page 76
Joseph Yodelslideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012
Page 77
Joseph Yodelslideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012
Page 78
What about Drupal?
Page 79
Simple Testdrupal.org/project/simpletest
Page 80
PHP Unitphpunit.de
drupal.org/phpunit
Page 81
Behat Extension
Module
drupal.org/project/drupalextension
Page 82
Barbor(BDD Framework)
github.com/barbor/barbor
Page 83
Questions & Answers
Page 84
Give your feedback!
latinamerica2015.drupal.org/session/best-practices-continuous-deployment-
drupal
Page 85
Let’s talk!
@revagomes
[email protected]
drupal.org/u/revagomes
about.me/revagomes