improving your drupal development workflow with continuous...

32
1 Improving your Drupal Development workflow with Continuous Integration DREAM IT. DRUPAL IT. Peter Drake Sahana Murthy

Upload: others

Post on 23-Jun-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

1

Improving your Drupal Development workflow with Continuous Integration

DREAM IT. DRUPAL IT.

Peter Drake Sahana Murthy

Page 2: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

2

Meet Us!!!!

Peter Drake •  Cloud Software Engineer @Acquia •  Drupal Developer & sometimes core contributor

Sahana Murthy •  Developer Evangelist @Acquia •  Open Source Proponent •  @sahanatweets

Page 3: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

3

Agenda!

àStandard Development Workflow •  What does it look like? •  What can go wrong and why?

à Continuous Integration workflow •  What does it look like? •  Why is it better? •  Demo!

Page 4: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

4

What do we mean by a “Standard Workflow”?

Page 5: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

5

Stage 1 – Hacking Code on Server!

Page 6: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

6

Stage 2 – Develop locally, push to production!

Page 7: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

7

Is the Standard Workflow ideal for today’s Agile World?

Page 8: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

8

What could go wrong?

Page 9: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

9

Common Pitfalls!à Deploying broken Code

•  Developers overwriting each others work •  Partial changes •  In-development changes •  Untested changes

à Deploying broken Config •  Missing libraries or dependencies •  Wrong Drupal config settings

à Deploying a broken Database Schema •  Failure to write schema update hooks •  Failure to run update.php •  Manual schema changes

Page 10: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

10

So…What is the RIGHT way???

Page 11: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

11

Stage 3 – Continuous Integration !

Page 12: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

12

What is Continuous Integration?!•  Continuous integration (CI) is software engineering’s best

practice of merging all developer working copies with a shared mainline several times a day.

Page 13: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

13

CI - Principles!

•  Use Version Control

•  Integrate Code Constantly

•  Test on Clone of Production

•  Automate Testing

•  Automate Deployment

Page 14: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

14

Use Version Control!Principles Recommendations

•  Git is a distributed revision control and source code management (sCM) system with an emphasis on speed.

•  Common Command: •  pull: grab changes from

repository. •  add: Index the changes. •  commit: track the changes. •  push: send changes to

repository. •  status: list which files are

staged, unstaged, or tracked.

•  Step “zero” for good software engineering

•  Version everything •  Code •  Config •  Database Schema •  Automate Tests •  Documentation •  Depenencies

Resources •  A Successful Git Branching Model •  Pro Git Book

Page 15: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

15

What problems does Version Control solve for us?"

Page 16: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

16

Page 17: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

17

Page 18: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

18

Page 19: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

19

Page 20: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

20

Page 21: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

21

Version Control - Overview!

Page 22: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

22

Integrate Code Constantly!Principles

•  Break big features into small

steps

•  Commit changes often

•  Automate the upgrade process

•  Implement tests as you go

•  Update from master branch daily

Results

•  Identify conflicts early on

•  Build quality is ensured

•  Test coverage is consistent

•  Development mistakes don’t

impact others’ velocity

Page 23: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

23

Test on a Clone of Production!

Principles •  Identical OS, Apache / MySQL /

Varnish, PHP extensions, PEAR

libraries, assorted packages

•  Use a current (scrubbed) version

of production database

•  Unify and automate build of all

environments

Results •  No more “It worked on my

machine!” or “It worked on the testing database!”

•  Manual server tweaks will not propagate to production

“Drupal depends heavily on its environment”

Page 24: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

24

Automate Testing!“If it ain’t broke, test it anyway.”

“If it isn’t tested, it doesn’t work.”

Principles Results

•  Tests: build, unit, browser-based

•  Run tests on every commit

•  Don’t merge changes until tests

pass

•  Announce when master breaks

•  Deploy frequently to QA

environment

•  Progress visibility for

stakeholders

•  Bugs discovered before

deployment

•  Consistent quality (QA)

Page 25: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

25

Automate Deployment!“Drag-and-Drop is as automated as

automated gets!!!”

Principles Results

•  Deployment should be a push-button-and-relax operation

•  Tag each release for future reference or rollback

•  Snapshot databases for rollback •  Change database schema via

code •  Update config via code •  No change is done until the

upgrade is automated

•  Deployments are worry-free

•  Eliminates human error

•  Ensures stakeholder

expectations are met

•  Enables continuous deployment

Page 26: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

26

In a Nutshell!!!

Page 27: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

27

Three Phase Development!

Page 28: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

28

Lets watch CI in"LIVE ACTION!

Page 29: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

29

Page 30: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

30

Whats’ next with CI and Drupal???

Page 31: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

31

Wait For It…

Page 32: Improving your Drupal Development workflow with Continuous ...drupalcampohio.org/sites/default/files/slides/Acquia CI Session... · Improving your Drupal Development workflow with

32

Drupal 8"W00T W00T!

Let’s  get  ‘er  done!