28
Continuous Integration is for Teams

Continuous Integration Is for Teams: Moving past buzzword driven development

Embed Size (px)

Citation preview

Continuous Integration

is for Teams

Pantheon.io

Agency and Community Engineer at Pantheon.

stevector on GitHub, Twitter, WordPress.org

Drupal.org

[email protected]

Hi, I’m Steve Persch

Pantheon.io

CTO at Last Call Media

rbayliss on GitHub, Twitter, Drupal.org

I make development processes better

And Rob Bayliss

In the context of websites, Continuous

Integration means frequently combining all

pending code changes with the latest content

from the “real world” of the production

environment. ― Josh Koenig

https://pantheon.io/blog/continuous-integration-delivery-and-deployment-behind-hype

Pantheon.io

Continuous Integration assumes...

http://xkcd.com/303/

● Compilation or building● Which takes significant time

(A truncated, PHP-centric)

Historyof the

World Wide Web

Pantheon.io

In the beginning:

A web page

HTML

CSS

JavaScript

Assets

Pantheon.io

The Internet of the 90s

Pantheon.io

Enter PHP: an interpreted language

Pantheon.io

"Compiling" happens on-demand

A web page

HTML

OptimizedCSS

OptimizedJavaScript

CMSPHP andDatabase

SourceCSS

SourceJavaScript

OptimizedAssets

SourceAssets

Pantheon.io

Things get complicated

Pantheon.io

Git repo

Drush Make andCustom code

Sass

CoffeeScript

The need for build steps

A web page

HTML

OptimizedCSS

OptimizedJavaScript

CMS

PHP andDatabase

CompiledCSS

Compiled JavaScript

Pantheon.io

Git repo

Sass

Who owns the CSS?

A web page

OptimizedCSS

CMS

CSS

Sass OptimizedCSS

Pantheon.io

Enter Dependency Management

Pantheon.io

Local Copy

Source files and task runners

15

We need build steps

A web page

HTML

OptimizedCSS

OptimizedJavaScript

Live Site

ProductionPHP

SourceCSS

Compiled JS

Production and dev PHP

Git Repo

ComposerAnd custom

code

NPM and custom code

Pantheon.io

It gets overwhelming

Continuous Integration is all about communication

― Martin Fowler

https://www.martinfowler.com/articles/continuousIntegration.html

Pantheon.io

The guidelines help communication

https://www.martinfowler.com/articles/continuousIntegration.html

● Maintain a Single Source Repository● Automate the Build● Make Your Build Self-Testing● Everyone Commits To the Mainline Every Day● Every Commit Should Build the Mainline on an Integration Machine● Fix Broken Builds Immediately● Keep the Build Fast● Test in a Clone of the Production Environment● Make it Easy for Anyone to Get the Latest Executable● Everyone can see what's happening● Automate Deployment

Pantheon.io

Continuous Buzzwords

Continuous Integration

Continuous Delivery

Continuous Deployment

Pantheon.io20

Continuous Integration: Assembling pieces

Git Repo

ComposerAnd custom

code

NPM and custom code

Backups from Live site

Database and media files

ServerDefinition

FunctioningCopy of Website

Server environment(nginx, version of PHP,

file system)

Code: PHP, CSS, JS

Database and media files

Pantheon.io

Continuous Buzzwords

Continuous Integration

Continuous Delivery

Pantheon.io

Continuous Delivery on Pantheon

● A development environment per branch●

Pantheon.io

Continuous Buzzwords

Continuous Integration

Continuous Delivery

Continuous Deployment

Pantheon.io

Continuous Deployment: Straight to Live

● A development environment per branch●

Pantheon.io

LCM Pantheon Workflow

● Work in a feature branch ● Push to Github● CI Runs Tests and deploys to Pantheon Multidev● PR to master● CI runs tests and deploys to Pantheon master

Pantheon.io

Artifact Deployment

Pantheon.io

Lessons We've Learned

● Start small and iterate● CD is process, not a checkbox● Prioritize flexible tools over single-use ones● Educate yourself about the testing process

https://github.com/LastCallMedia/Drupal-Scaffold

Questions?