1 of 88

Deploying Drupal

And surviving to tell the story

2 of 88

Who is this guy?

3 of 88

Who is this guy?

David Hernández

Drupal Developer

4 of 88

Who is this guy?

David Hernández

Drupal Developer

Twitter

@david_baltha

5 of 88

Who is this guy?

David Hernández

Drupal Developer

Twitter

@david_baltha

6 of 88

What I’m going to talk about?

7 of 88

Deploying a project is more than the deploy process

8 of 88

The project

What do we want to build?

9 of 88

There are different types of projects

10 of 88

Big projects

11 of 88

12 of 88

Small projects

13 of 88

14 of 88

The projects can be really different

15 of 88

But all of them have something in common:

16 of 88

We have to ensure the quality

17 of 88

The materials

Setting up a good structure

18 of 88

What do we use is important

19 of 88

20 of 88

21 of 88

How do we use them, is important too

22 of 88

We have to use the best tools we have

23 of 88

We need to know how to use them

24 of 88

The process

Doing it in the correct way

25 of 88

Even when we have the best materials

26 of 88

And when we use them correctly

27 of 88

A project can end up badly

28 of 88

29 of 88

Doesn’t matter how big the project is

30 of 88

31 of 88

The project fundations

Tools and good practices

32 of 88

Configuration must be versioned

33 of 88

Configuration to code

34 of 88

Configuration to code

  • Features [1]

35 of 88

Configuration to code

  • Features [1]
  • Hook update & hook install

36 of 88

Configuration to code

  • Features [1]
  • Hook update & hook install
  • Strongarm [2]

37 of 88

Configuration to code

  • Features [1]
  • Hook update & hook install
  • Strongarm [2]
  • Context [3] or Panels [4]

38 of 88

Configuration to code

  • Features [1]
  • Hook update & hook install
  • Strongarm [2]
  • Context [3] or Panels [4]
  • Bean [5] / Boxes [6]

39 of 88

Configuration to code

  • Features
  • Hook update & hook install
  • Strongarm
  • Context or Panels
  • Beans / Boxes

What I recommend

40 of 88

Structure your code

41 of 88

Packaging your site

42 of 88

Packaging your site

  • Installation profile [7]

43 of 88

Packaging your site

  • Installation profile [7]
  • Drush make [8]

44 of 88

Packaging your site

  • Installation profile [7]
  • Drush make [8]
  • Phar [9]

45 of 88

Packaging your site

  • Installation profile [7]
  • Drush make [8]
  • Phar [9]
  • Phing [10] [11]

46 of 88

Packaging your site

  • Installation profile
  • Drush make
  • Phar
  • Phing

I recommend

47 of 88

The deploy

Different deployment approaches

48 of 88

First step

49 of 88

50 of 88

The old way

51 of 88

Old style deployment

  1. Code update

52 of 88

Old style deployment

  • Code update
  • Replicate changes

53 of 88

Old style deployment

  • Code update
  • Replicate changes

54 of 88

55 of 88

What do we need?

56 of 88

Requirements

  • Minimum downtime

57 of 88

Requirements

  • Minimum downtime
  • Easy rollbacks

58 of 88

Requirements

  • Minimum downtime
  • Easy rollbacks
  • Automation

59 of 88

What steps are needed?

60 of 88

Steps

  • Update code

61 of 88

Steps

  • Update code
  • Update database

62 of 88

Steps

  • Update code
  • Update database
  • Put config back to DB

63 of 88

Some alternatives

64 of 88

The Capistrano way

65 of 88

How does it work?

  • Creates a new release

66 of 88

How does it work?

  • Creates a new release
  • Updates database

67 of 88

How does it work?

  • Creates a new release
  • Updates database
  • Enables release

68 of 88

Pros & Cons

69 of 88

Pros & Cons

  • No downtime

70 of 88

Pros & Cons

  • No downtime
  • Easy rollback

71 of 88

Pros & Cons

  • No downtime
  • Easy rollback
  • Suits all projects

72 of 88

Pros & Cons

  • No downtime
  • Easy rollback
  • Suits all projects
  • Needs a full release

73 of 88

Pros & Cons

  • No downtime
  • Easy rollback
  • Suits all projects
  • Needs a full release
  • Slow

74 of 88

How can I use it?

  • Capistrano [12] [16]
  • Bash scripts [13]
  • Drush commands [14] [15]

75 of 88

Demo time!

76 of 88

WF Tools

WFT not WTF

77 of 88

How does it work?

  • Uses Jenkins CI

78 of 88

How does it work?

  • Uses Jenkins CI
  • Does small code deploys

79 of 88

How does it work?

  • Uses Jenkins CI
  • Does small code deploys
  • Does content deploys

80 of 88

Pros & Cons

81 of 88

Pros & Cons

  • No downtime

82 of 88

Pros & Cons

  • No downtime
  • Small and quick deploys

83 of 88

Pros & Cons

  • No downtime
  • Small and quick deploys
  • Fully automated

84 of 88

Pros & Cons

  • No downtime
  • Small and quick deploys
  • Fully automated
  • Hard to set up

85 of 88

Pros & Cons

  • No downtime
  • Small and quick deploys
  • Fully automated
  • Hard to set up
  • Still a dev version

86 of 88

Demo time!

87 of 88

Questions?

88 of 88

Thank you