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

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

Jul 19, 2015

Download

Technology

Taller
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015

Best Practices for CDwith Drupal

Renato Vasconcellos

[email protected]

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

What you’re about to

see in this

presentation?

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

● What’s Continuous Deployment

● Tools & Modules

● Development Workflow

● Tips & Resources

Agenda

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

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: Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015

What means Deploy?

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

“Placement of

equipment and troops

in a battlefield.”

www.webopedia.com/TERM/D/deploy.html

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

“To install, test and

implement an

application or computer

system.”www.webopedia.com/TERM/D/deploy.htm

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

Continuous Integration?

Continuous Delivery?

Continuous

Deployment?

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

Continuous Integration

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

To integrate your work

constantly with your

team members.

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

Continuous Delivery

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

Provide your work

constantly for review

by the team or client.

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

Continuous

Deployment

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

Deploy your work

constantly into

client’s server.

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

Continuous Deployment

is a reflex the team’s

culture and discipline.

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

Continuous

Deployment

in 5 steps

Eric Ries - O'Reilly Radar

http://lb.cm/dploy5stps

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

CI Server(Continuous Integration server)

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

Source control

commit check

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

Simple

deployment

scripts

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

Real-time

alerting

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

Root cause

analysis(the five whys)

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

Where/how to start?

Image by Jalel

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

Standardized

Workflow

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

Work Agreements

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

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: Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015

Coding Standards

drupal.org/coding-standards

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

Everything in Code

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

Test Driven

Development

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

CI/CD Server

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

Make your choice

● Jenkins

● CircleCI

● Codeship

● Strider CD

● Dploy

● Travis CI

● Go

● Other

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

Deploy on Green!

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

Development

Workflow

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

Pipeline

Develop.

Test/QA

Productio

n

UAT/Stagin

g

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

Development

Environment

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

Development environment

should resemble the

production environment.

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

Test/QA

Environment

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

QA environment

should resemble the

production environment.

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

UAT/Staging/Pre-prod

Environment

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

UAT environment

must resemble the

production environment.

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

Production

Environment

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

Recap.

Develop.

Test/QA

http://dltj.org/article/software-development-practice/

http://spacebug.com/effective_development_environments/

Productio

n

UAT/Stagin

g

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

What about Drupal?

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

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 44: Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015

Drush

drush.org

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

Install Profiles /

Custom Distributions

drupal.org/documentation/build/distributions

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

Strongarm Moduledrupal.org/project/strongarm

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

Features Moduledrupal.org/project/features

drupal.org/documentation/modules/features

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

Default Config Moduledrupal.org/project/defaultconfig

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

Custom

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

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

Configuration Management

Moduledrupal.org/project/configuration

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

UUID Moduledrupal.org/project/uuid

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

Deploy Moduledrupal.org/project/deploy

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

WF Tools Moduledrupal.org/project/wf_tools

Page 54: Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015
Page 55: Best practices for Continuous Deployment with Drupal - DrupalCon Latin América 2015

Git Workflow

atlassian.com/git/workflows

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

Centralized

workflow

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

Feature branch

workflow

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

Git flow

workflow

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

Forking

workflow

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

A successful

git branch model?

Vincent Driessennvie.com/posts/a-successful-git-branching-model

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

Git flow

Workflow

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

Git flow cheat sheethttp://danielkummer.github.io/git-flow-cheatsheet/

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

.git/Hooks

git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

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

Client Side

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

Pre

Commit

● Coding Standards (Lint)

● Automated tests

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

Post

Checkout

● Automated tests

● Broken branch check

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

Server Side

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

Pre

Receive

● Coding Standards (Lint)

● Automated tests

● Branch protection

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

Post

Receive

● Load tests

● Notifications

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

What about Drupal?

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

Coder Module

drupal.org/project/coder

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

PAReview script

drupal.org/project/pareviewsh

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

Drupal Code Quality

Moduledrupal.org/project/dcq

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

Automated Tests

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

Automated Tests brings

security and reliability

to a continual

improvement process.

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

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

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

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

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

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

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

What about Drupal?

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

Simple Testdrupal.org/project/simpletest

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

PHP Unitphpunit.de

drupal.org/phpunit

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

Behat Extension

Module

drupal.org/project/drupalextension

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

Barbor(BDD Framework)

github.com/barbor/barbor

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

Questions & Answers

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

Give your feedback!

latinamerica2015.drupal.org/session/best-practices-continuous-deployment-

drupal

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

Let’s talk!

@revagomes

[email protected]

drupal.org/u/revagomes

about.me/revagomes