best practices for continuous deployment with drupal - drupalcon latin américa 2015

85
Best Practices for CD with Drupal Renato Vasconcellos [email protected]

Upload: taller

Post on 19-Jul-2015

398 views

Category:

Technology


1 download

TRANSCRIPT

Best Practices for CDwith Drupal

Renato Vasconcellos

[email protected]

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 Machinedrupal.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 Moduledrupal.org/project/strongarm

Features Moduledrupal.org/project/features

drupal.org/documentation/modules/features

Default Config Moduledrupal.org/project/defaultconfig

Custom

Deployment Modulebefused.com/drupal/site-deployment-module

Configuration Management

Moduledrupal.org/project/configuration

UUID Moduledrupal.org/project/uuid

Deploy Moduledrupal.org/project/deploy

WF Tools Moduledrupal.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 Driessennvie.com/posts/a-successful-git-branching-model

Git flow

Workflow

Git flowhttps://github.com/nvie/gitflow

Git flow cheat sheethttp://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

Moduledrupal.org/project/dcq

Automated Tests

Automated Tests brings

security and reliability

to a continual

improvement process.

Joseph Yodelslideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012

Joseph Yodelslideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012

Joseph Yodelslideshare.net/yodamann/pragmatic-not-dogmatic-tdd-agile2012

What about Drupal?

Simple Testdrupal.org/project/simpletest

PHP Unitphpunit.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

[email protected]

drupal.org/u/revagomes

about.me/revagomes