Drupal and Continuous Integration DrupalCampNJ - 2014 Who we are - - PowerPoint PPT Presentation

drupal and continuous integration
SMART_READER_LITE
LIVE PREVIEW

Drupal and Continuous Integration DrupalCampNJ - 2014 Who we are - - PowerPoint PPT Presentation

Drupal and Continuous Integration DrupalCampNJ - 2014 Who we are Henry Umansky Jason Howe Princeton University Drew University humansky@princeton. jhowe@drew.edu edu What is Continuous Integration? Continuous Integration is a software


slide-1
SLIDE 1

Drupal and Continuous Integration

DrupalCampNJ - 2014

slide-2
SLIDE 2

Who we are

Henry Umansky Princeton University humansky@princeton. edu Jason Howe Drew University jhowe@drew.edu

slide-3
SLIDE 3

What is Continuous Integration?

“Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.”

  • Martin Fowler
slide-4
SLIDE 4

Principles of CI?

  • Maintain a code repository
  • Automate the build
  • Make the build self-testing
  • Everyone commits to the baseline every day
  • Every commit (to baseline) should be built
  • Keep the build fast
slide-5
SLIDE 5

Principles of CI (cont’d)

  • Test in a clone of the production

environment

  • Make it easy to get the latest deliverables
  • Everyone can see the results of the latest

build

  • Automate deployment
slide-6
SLIDE 6

Advantages of CI

  • prevent integration problems
  • identify failing code early
  • immediate unit testing of all changes
  • "current" build for testing, demo, or releases
slide-7
SLIDE 7

Disadvantages of CI

  • Initial setup time required
  • Well-developed test-suite required to

achieve automated testing advantages

slide-8
SLIDE 8

Maintain a code repository

  • Version Control Systems: git or svn
  • use Features as much as possible
  • Strongarm Module
slide-9
SLIDE 9

Automate the Build

  • Hudson/Jenkins
  • Drush
  • Build triggers
slide-10
SLIDE 10

Make the build self-testing

  • Drupal Coder Review/Security Review
  • Code Quality - [ php | css | js ] lint
  • PhantomJS and Selenium
  • Checkstyles/PHPMD
slide-11
SLIDE 11

Daily Commits

  • Commit at least once a day
  • Reduces potential conflicts
  • Triggers automated builds
slide-12
SLIDE 12

Demo

slide-13
SLIDE 13

Automated Deployment

  • Identical /dev/qa/prod systems
  • Trivial to move code between environments
  • Single button click to perform complex tasks
slide-14
SLIDE 14

Automated Deployment

  • Single button click to deploy

production code to n webservers.

  • Deployment is simply a “git pull”,

executed via remote ssh.

  • Auto deployment to dev upon code

commit to dev.

slide-15
SLIDE 15

Achieving Identical Environments

  • Everything has to be automated, no lovingly

handcrafted environments.

  • Bash script fired by Jenkins, builds

databases, instantiates drupal instance in all environments.

  • Tools to sync content from prod->dev and

code from dev->prod

slide-16
SLIDE 16

Known state of environments

  • You always know that Dev contains

everyone’s latest contributions.

  • You always know that Prod is a copy of

what’s in the repo.

slide-17
SLIDE 17

From the Operations Perspective

  • Keep Server configs in (my.cnf, http.conf,

etc) in a configuration repository.

  • New webhead is trivial:

○ checkout config repo and run setup script. ○ symlinks config files, checkout drupal. ○ Essentially a self-configuring server

  • Works for DR too!
slide-18
SLIDE 18

Other Advantages for Ops

  • Knowing, without a doubt the current system

state.

  • Ability to spin up a test environment in

minutes.

  • Aids in troubleshooting and quick issue
  • resolution. (Good comments commits help

too)

slide-19
SLIDE 19

Questions?