SlideShare a Scribd company logo
Drupal Developers Day 2013
Microsoft PH

6750 Ayala Avenue, Makati City
Our Goal?
Zero Touch
Deployment
Zero Downtime
During
Deployment
Deployment
Syndrome
Fear of Change (before and after delivery)
Deployment
Syndrome
It works on my machine*
Deployment
Syndrome
Silo-isolation (different software stack)
DevOps { 'Drupal':
cooking => deployment,
}

Gerald Villorente

Senior DevOps Engineer | Open-Source Enthusiast
FTP

used to transfer files from one host to another host over a TCP-based
network
Prehistoric
Slow
Not Secure
No version
control
Manual
Configuration
Risky
Repetitive
Solution?
Automate
not applicable in shared-hosting
Tools
Git

Git /ɡɪt/ is a distributed revision control and source code
management (SCM) system with an emphasis on speed. - Wikipedia
Git Hooks: Post


Post-code-deploy (post-merge, post-checkout, etc)



Post-db-copy



Post-files-copy
Git Hooks: Post-code-deploy
drush -vdy @domain.prod updb
drush -vdy @domain.prod fra
drush -vdy @domain.prod cc all
Git Hooks: Post-code-deploy
drush
drush
drush
drush

-vdy
-vdy
-vdy
-vdy

@domain.uat
@domain.uat
@domain.uat
@domain.uat

cc all
updb
fra
cc all
Git Hooks: Post-code-deploy
drush
drush
drush
drush

-vdy
-vdy
-vdy
-vdy

@domain.stage
@domain.stage
@domain.stage
@domain.stage

cc all
updb
fra
cc all
Git Hooks: Post-code-deploy
drush
drush
drush
drush

-vdy
-vdy
-vdy
-vdy

@domain.dev
@domain.dev
@domain.dev
@domain.dev

cc all
updb
fra
cc all
Git Hooks: Post-db-copy
drush
drush
drush
drush

@domain.uat
@domain.uat
@domain.uat
@domain.uat

cc all
updb -y
fra -y
cc all
Git Hooks: Post-db-copy
drush @domain.stage cc all
drush @domain.stage updb -y
drush @domain.stage en views_ui -y
drush @domain.stage en context_ui -y
drush @domain.stage fra -y
drush @domain.stage dis chartbeat -y
drush @domain.stage vset cdn_status 0 -y
drush @domain.stage solr-vset conf[apachesolr_read_only] 1 -y
drush @domain.stage vset preprocess_js 0 -y
drush @domain.stage vset preprocess_css 0 -y
drush @domain.stage vset purge_proxy_urls
'http://stage.domain.com/?purge_method=ah' -y
drush @domain.stage cc all
Git Hooks: Post-db-copy
drush @domain.dev cc all
drush @domain.dev updb -y
drush @domain.dev en views_ui -y
drush @domain.dev en context_ui -y
drush @domain.dev fra -y
drush @domain.dev dis chartbeat -y
drush @domain.dev vset cdn_status 0 -y
drush @domain.dev vset conf[apachesolr_read_only] 1 -y
drush @domain.dev vset preprocess_js 0 -y
drush @domain.dev vset preprocess_css 0 -y
drush @domain.dev vset purge_proxy_urls
'http://stage.domain.com/?purge_method=ah' -y
drush @domain.dev cc all
Git Hooks: Post-files-copy


Will run after finished copying files
- from prod to uat, stage, and or dev
- from uat to stage or dev
- from stage to uat or dev
- from dev to uat or stage
Managing Files


Don't put in version control



Use rsync
Git Hooks: Pre


Pre-commit



Prepare-commit-msg



Pre-applypatch



Pre-rebase
Drush

is a command-line shell and scripting interface for Drupal, a veritable
Swiss Army knife designed to make life easier for those who spend
their working hours hacking away at the command prompt
Drush: Clear Cache
Command:
$ drush cc all
Drush: Run hook_update
Command:
$ drush updb -y
$ drush @domain.prod updb -y
Drush Make
Drush: Make Capabilities


Downloading Drupal core, as well as contrib modules from drupal.org.



Checking code out from SVN, git, and bzr repositories.







Getting plain `.tar.gz` and `.zip` files (particularly useful for libraries
that can not be distributed directly with drupal core or modules).
Fetching and applying patches.
Fetching modules, themes, and installation profiles, but also external
libraries.
Useful Drush
Commands
not really important in deployment
Drush: SQL Login
Command:
$ drush sql-cli
Drush: SQL Query
Command:
$ drush sqlq “UPDATE users SET
pass=$S$DHaDeIifGS5qiS7ghhEolZ9lbaRTkZh/UcU.dh
ZY0Rpp1gUooEpQ WHERE uid=1”
Drush: SQL Sync
Command:
$ drush sql-sync @prod @dev
Drush: SQL Create
Command:
$ drush sql-create
$ drush @domain.dev sql-create
Drush: SQL Drop
Command:
$ drush sql-drop
$ drush @domain.dev sql-drop
Drush: SQL Dump
Command:
$ drush sql-dump
--result-file=../bck.sql
Options:
--gzip
--result-file
Drush: Variable Set
Command:
$ drush vset preprocess_js 1 -y
Drush: Module Enable
Command:
$ drush en views -y
$ drush en features views_ui -y
Drush: Module Disable
Command:
$ drush dis views -y
$ drush dis features views_ui -y
Drush: Module Uninstall
Command:
$ drush pm-uninstall views -y
$ drush pm-uninstall ctools views -y
Drush: One-time Login
Command:
$ drush uli gerald
$ drush uli –browser=firefox --mail=drush@example.org
Drush: Update Password
Command:
$ drush upwd gerald
--password=foo
Use Site Alias
Allows you to execute Drush commands in target remote
server via ssh
Command:
$ drush @domain.prod updb -y
Features

Enables the capture and management of features in Drupal. A feature
is a collection of Drupal entities which taken together satisfy a
certain use-case.
Features: Create
Features: Manage
Features: Module
Features: Drush Integration
features-revert-all

(fra)

Revert all enabled feature module on your site.

Command:
drush fra -y

Options:
--force
Bash

A command processor, typically run in a text window, allowing the
user to type commands which cause actions. Bash can also read
commands from a file, called a script. Like all Unix shells, it supports
filename wildcarding, piping, here documents, command
substitution, variables and control structures for condition-testing
and iteration. - Wikipedia
DevOps: Cooking Drupal Deployment
Bash Scripting: Sample
#!/usr/bin/env bash
path=”sites/all/default/files”
if [ ! -d “$path”]; then
mkdir $path
chown www-data:www-data $path
fi
Bash Scripting: Drush
#!/usr/bin/env bash
drush cc all
drush updb -y
drush fra -y
drush cc all
echo “Delployment done!”
I don't know Bash!
You can also use Python, Shell, or Perl. Use the one that
you're comfortable with. Just remember, DRY and KISS.
Drupal API
hook_update_N
hook_update_N: Sample
/**
* Enable Test module.
*/
function test_update_7001() {
$module = array('test');
module_enable($module);
}
Demo
What we
achieved?
We used Git to managed
the entire deployment.
We used Features to
capture database
changes.
We used Drush to run the
hook_update_N, revert
the features, and clear
the cache.
We created a Bash script
that contains deployment
process run by Git.
Related
DevOps Tools
Puppet

Open-souce automation software that helps system administrators
manage infrastructure throughout its lifecycle, from provisioning and
configuration to orchestration and reporting.
Chef

A systems and cloud infrastructure automation framework that
makes it easy to deploy servers and applications to any physical,
virtual, or cloud location, no matter the size of the infrastructure.
Ansible

Ansible configures operating systems, deploys applications, runs
parallel commands, and orchestrates IT processes like zero-downtime
rolling updates. It uses SSH by default, so no special software has to
be installed to start managing remote machines. Modules can be
written in any language.
Juju

Juju is a powerful service orchestration tool from Ubuntu that helps
you define, configure and deploy services to any cloud quickly and
easily.
Capistrano

Capistrano was originally designed to simplify and automate
deployment of web applications to distributed environments.
Docker

Docker is an open-source project to easily create lightweight,
portable, self-sufficient containers from any application. The same
container that a developer builds and tests on a laptop can run at
scale, in production, on VMs, bare metal, OpenStack clusters, public
clouds and more.
Foreman

for managing physical and virtual server
Travis CI

distributed continuous integration service used to build and test
projects
Jenkins

An extendable open source continuous integration server. Built with
Java, it provides 829 plugins to support building and testing virtually
any project.
Maven

Maven allows a project to build using its project object model (POM)
and a set of plugins that are shared by all projects using Maven,
providing a uniform build system.
rsync

Is a file transfer program for Unix systems. rsync uses the "rsync
algorithm" which provides a very fast method for bringing remote
files into sync. It does this by sending just the differences in the files
across the link, without requiring that both sets of files are present
at one of the ends of the link beforehand.
Questions?
Resoures


http://devops.com



http://devo.ps



http://dev2ops.org



http://devopsweekly.com



http://devopsdays.org



http://drush.ws



http://try.github.io



http://tldp.org/LDP/abs/html
Contact Details
http://about.me/gerald.villorente
10-26-13

More Related Content

PDF
Devops For Drupal
PDF
DevOps and Drupal
PPTX
Drupal Continuous Integration with Jenkins - The Basics
PDF
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
PDF
PuppetConf 2016: A Tale of Two Hierarchies: Group Policy & Puppet – Matt Ston...
KEY
Drupal Deployment
PDF
Improving Engineering Processes using Hudson - Spark IT 2010
PDF
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
Devops For Drupal
DevOps and Drupal
Drupal Continuous Integration with Jenkins - The Basics
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
PuppetConf 2016: A Tale of Two Hierarchies: Group Policy & Puppet – Matt Ston...
Drupal Deployment
Improving Engineering Processes using Hudson - Spark IT 2010
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose

What's hot (20)

PPTX
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
PPTX
Hudson
 
PDF
Building a Drupal site with Git
PDF
Using Git with Drupal
PDF
Automated Drupal deployment with Git and Capistrano
PPTX
7 Habits of Highly Effective Jenkins Users
ODP
7 Habits of Highly Effective Jenkins Users
PDF
Dockerize Laravel Application
PDF
Hudson: Your robotic butler
PDF
At Your Service: Using Jenkins in Operations
PPTX
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
PPTX
Jenkins tutorial
PDF
7 Ways to Optimize Hudson in Production
PPTX
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
PDF
Hudson at FISL 2009
PPTX
Jenkins days workshop pipelines - Eric Long
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PPTX
Package Management on Windows with Chocolatey
PDF
Puppet Camp Charlotte 2015: Manage Your Switches Like Servers
PDF
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Hudson
 
Building a Drupal site with Git
Using Git with Drupal
Automated Drupal deployment with Git and Capistrano
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Dockerize Laravel Application
Hudson: Your robotic butler
At Your Service: Using Jenkins in Operations
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Jenkins tutorial
7 Ways to Optimize Hudson in Production
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Hudson at FISL 2009
Jenkins days workshop pipelines - Eric Long
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Package Management on Windows with Chocolatey
Puppet Camp Charlotte 2015: Manage Your Switches Like Servers
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Ad

Viewers also liked (8)

PPTX
Getting agile with drupal
ZIP
Drupal Deployment
PPTX
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
PPT
Staging Drupal: Change Management Strategies for Drupal
PPTX
Drupal Continuous Integration with Jenkins - Deploy
PPT
Scaling drupal horizontally and in cloud
PDF
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
PPT
Architecture of Drupal - Drupal Camp
Getting agile with drupal
Drupal Deployment
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Staging Drupal: Change Management Strategies for Drupal
Drupal Continuous Integration with Jenkins - Deploy
Scaling drupal horizontally and in cloud
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Architecture of Drupal - Drupal Camp
Ad

Similar to DevOps: Cooking Drupal Deployment (20)

KEY
Depolying Drupal with Git, Drush Make and Capistrano
PDF
CI workflow in a web studio
PDF
Automatisation in development and testing - within budget [IronCamp prague 20...
PDF
Modernize Your Drupal Development
PPTX
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
PDF
Docman - The swiss army knife for Drupal multisite docroot management and dep...
PPT
Drush Productivity FTW - DUG @ Krimson
PPTX
Drupal & Continous Integration - SF State Study Case
PPT
Automating Drupal Deployment
PDF
Drush workshop
PDF
DevOps for Drupal: Why We Cook With Chef
PDF
How to Use the Command Line to Increase Speed of Development
PDF
Сontinuous Integration - step to continuous deployment
ZIP
Staging and Deployment
KEY
Intro to Drush
ODP
Travis Carden/Drupal Nebraks: Drush Presentation
PDF
Recipes for Drupal distributions
PDF
Intro to Git for Drupal 7
PDF
Efficient development workflows with composer
PDF
Cloud Driven Development: a better workflow, less worries, and more power
Depolying Drupal with Git, Drush Make and Capistrano
CI workflow in a web studio
Automatisation in development and testing - within budget [IronCamp prague 20...
Modernize Your Drupal Development
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Drush Productivity FTW - DUG @ Krimson
Drupal & Continous Integration - SF State Study Case
Automating Drupal Deployment
Drush workshop
DevOps for Drupal: Why We Cook With Chef
How to Use the Command Line to Increase Speed of Development
Сontinuous Integration - step to continuous deployment
Staging and Deployment
Intro to Drush
Travis Carden/Drupal Nebraks: Drush Presentation
Recipes for Drupal distributions
Intro to Git for Drupal 7
Efficient development workflows with composer
Cloud Driven Development: a better workflow, less worries, and more power

More from Gerald Villorente (20)

PDF
Of Docker and Drupal
PDF
Introduction to Kalabox
PDF
Drupal Development : Tools, Tips, and Tricks
PDF
Drupal 101 V-0.1
PDF
BITS 2015: The Beauty of Drupal
ODP
Introduction to Drupal 7
PDF
Introduction to Drupal - Installation, Anatomy, Terminologies
PDF
Consistent Development Environment with Vagrant and Chef
PDF
Drush Deployment Manager: Deployment Made Easy
PDF
Consistent Development Environment using Vagrant and Chef
PDF
Why Drupal is Rockstar?
PDF
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
ODP
Best Practices: Drupal Development
ODP
Drupal Deployment and Essential Development Tools - 2nd Edition
ODP
Drupal Deployment and Essential Development Tools
ODP
Setting Up Cross-Browser Testing Environment (Debian-based System)
ODP
Git: Git'ing the Basic
ODP
Anatomy of Drupal
ODP
Drupal Security Hardening
Of Docker and Drupal
Introduction to Kalabox
Drupal Development : Tools, Tips, and Tricks
Drupal 101 V-0.1
BITS 2015: The Beauty of Drupal
Introduction to Drupal 7
Introduction to Drupal - Installation, Anatomy, Terminologies
Consistent Development Environment with Vagrant and Chef
Drush Deployment Manager: Deployment Made Easy
Consistent Development Environment using Vagrant and Chef
Why Drupal is Rockstar?
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
Best Practices: Drupal Development
Drupal Deployment and Essential Development Tools - 2nd Edition
Drupal Deployment and Essential Development Tools
Setting Up Cross-Browser Testing Environment (Debian-based System)
Git: Git'ing the Basic
Anatomy of Drupal
Drupal Security Hardening

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Mobile App Security Testing_ A Comprehensive Guide.pdf
Big Data Technologies - Introduction.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Monthly Chronicles - July 2025
Empathic Computing: Creating Shared Understanding

DevOps: Cooking Drupal Deployment