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

What's hot (20)

PPTX
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
 
PPTX
Hudson
8x8
 
PDF
Building a Drupal site with Git
dirtytactics
 
PDF
Using Git with Drupal
Ryan Cross
 
PDF
Automated Drupal deployment with Git and Capistrano
Savvy - Automated profiles for developers
 
PPTX
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
ODP
7 Habits of Highly Effective Jenkins Users
Andrew Bayer
 
PDF
Dockerize Laravel Application
Afrimadoni Dinata
 
PDF
Hudson: Your robotic butler
Steven Merrill
 
PDF
At Your Service: Using Jenkins in Operations
Mandi Walls
 
PPTX
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Puppet
 
PPTX
Jenkins tutorial
Mamun Rashid, CCDH
 
PDF
7 Ways to Optimize Hudson in Production
CloudBees
 
PPTX
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
PDF
Hudson at FISL 2009
Arun Gupta
 
PPTX
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
PPTX
Package Management on Windows with Chocolatey
Puppet
 
PDF
Puppet Camp Charlotte 2015: Manage Your Switches Like Servers
Puppet
 
PDF
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
CloudBees
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
 
Hudson
8x8
 
Building a Drupal site with Git
dirtytactics
 
Using Git with Drupal
Ryan Cross
 
Automated Drupal deployment with Git and Capistrano
Savvy - Automated profiles for developers
 
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
7 Habits of Highly Effective Jenkins Users
Andrew Bayer
 
Dockerize Laravel Application
Afrimadoni Dinata
 
Hudson: Your robotic butler
Steven Merrill
 
At Your Service: Using Jenkins in Operations
Mandi Walls
 
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Puppet
 
Jenkins tutorial
Mamun Rashid, CCDH
 
7 Ways to Optimize Hudson in Production
CloudBees
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
Hudson at FISL 2009
Arun Gupta
 
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Package Management on Windows with Chocolatey
Puppet
 
Puppet Camp Charlotte 2015: Manage Your Switches Like Servers
Puppet
 
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
CloudBees
 

Viewers also liked (8)

PPTX
Getting agile with drupal
Promet Source
 
ZIP
Drupal Deployment
Jeff Eaton
 
PPTX
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Taller Negócio Digitais
 
PPT
Staging Drupal: Change Management Strategies for Drupal
Erich Beyrent
 
PPTX
Drupal Continuous Integration with Jenkins - Deploy
John Smith
 
PPT
Scaling drupal horizontally and in cloud
Vladimir Ilic
 
PDF
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Dropsolid
 
PPT
Architecture of Drupal - Drupal Camp
Dipen Chaudhary
 
Getting agile with drupal
Promet Source
 
Drupal Deployment
Jeff Eaton
 
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Taller Negócio Digitais
 
Staging Drupal: Change Management Strategies for Drupal
Erich Beyrent
 
Drupal Continuous Integration with Jenkins - Deploy
John Smith
 
Scaling drupal horizontally and in cloud
Vladimir Ilic
 
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Dropsolid
 
Architecture of Drupal - Drupal Camp
Dipen Chaudhary
 
Ad

Similar to DevOps: Cooking Drupal Deployment (20)

KEY
Depolying Drupal with Git, Drush Make and Capistrano
libsys
 
PDF
CI workflow in a web studio
deWeb
 
PDF
Automatisation in development and testing - within budget [IronCamp prague 20...
David Lukac
 
PDF
Modernize Your Drupal Development
Chris Tankersley
 
PPTX
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
LEDC 2016
 
PDF
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Aleksey Tkachenko
 
PPT
Drush Productivity FTW - DUG @ Krimson
Kristof Van Roy
 
PPTX
Drupal & Continous Integration - SF State Study Case
Emanuele Quinto
 
PPT
Automating Drupal Deployment
Gerald Villorente
 
PDF
Drush workshop
Juampy NR
 
PDF
DevOps for Drupal: Why We Cook With Chef
Promet Source
 
PDF
How to Use the Command Line to Increase Speed of Development
Acquia
 
PDF
Сontinuous Integration - step to continuous deployment
Игорь Родионов
 
ZIP
Staging and Deployment
heyrocker
 
KEY
Intro to Drush
Four Kitchens
 
ODP
Travis Carden/Drupal Nebraks: Drush Presentation
Drupal Nebraska
 
PDF
Recipes for Drupal distributions
Lakshmi Narasimhan Parthasarathy
 
PDF
Intro to Git for Drupal 7
Chris Caple
 
PDF
Efficient development workflows with composer
nuppla
 
PDF
Cloud Driven Development: a better workflow, less worries, and more power
Marzee Labs
 
Depolying Drupal with Git, Drush Make and Capistrano
libsys
 
CI workflow in a web studio
deWeb
 
Automatisation in development and testing - within budget [IronCamp prague 20...
David Lukac
 
Modernize Your Drupal Development
Chris Tankersley
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
LEDC 2016
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Aleksey Tkachenko
 
Drush Productivity FTW - DUG @ Krimson
Kristof Van Roy
 
Drupal & Continous Integration - SF State Study Case
Emanuele Quinto
 
Automating Drupal Deployment
Gerald Villorente
 
Drush workshop
Juampy NR
 
DevOps for Drupal: Why We Cook With Chef
Promet Source
 
How to Use the Command Line to Increase Speed of Development
Acquia
 
Сontinuous Integration - step to continuous deployment
Игорь Родионов
 
Staging and Deployment
heyrocker
 
Intro to Drush
Four Kitchens
 
Travis Carden/Drupal Nebraks: Drush Presentation
Drupal Nebraska
 
Recipes for Drupal distributions
Lakshmi Narasimhan Parthasarathy
 
Intro to Git for Drupal 7
Chris Caple
 
Efficient development workflows with composer
nuppla
 
Cloud Driven Development: a better workflow, less worries, and more power
Marzee Labs
 
Ad

More from Gerald Villorente (20)

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

Recently uploaded (20)

PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
July Patch Tuesday
Ivanti
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Biography of Daniel Podor.pdf
Daniel Podor
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 

DevOps: Cooking Drupal Deployment