continuous delivery applied (agile richmond)

68
Continuous Delivery Applied Mike McGarr [email protected] @jmichaelmcgarr http://earlyandoften.wordpress.com http://www.meetup.com/DC-continuous- integration/

Upload: mike-mcgarr

Post on 11-May-2015

2.112 views

Category:

Technology


0 download

DESCRIPTION

Writing code is fun, but deploying to production is not. Production releases are scary events that last all weekend, and you find yourself worrying about how it will go. Did we miss a configuration file? Is the database schema the same as the one in the test environment? Does the last minute hot fix we just applied break any other features? Did I forget to include an installation instruction for the system administrators? Continuous Delivery is a collection of principles and practices aimed at addressing the problems teams typically face when releasing changes to production. By applying rigorous automation, testing and configuration management, teams are able to confidently and consistently deploy changes from version control to production without fear. In this talk, Mike McGarr will provide listeners with an introduction into the world of Continuous Delivery. After an introduction into the concepts and principles of Continuous Delivery, he will discuss many of the techniques for implementing Continuous Delivery and recommend some tools that can be used on your development project.

TRANSCRIPT

Page 1: Continuous Delivery Applied (Agile Richmond)

Continuous DeliveryApplied

Mike [email protected]@jmichaelmcgarrhttp://earlyandoften.wordpress.com http://www.meetup.com/DC-continuous-integration/

Page 2: Continuous Delivery Applied (Agile Richmond)

• J. Michael (Mike) McGarr

• 11 years as an IT consultant

• Director of DevOps for Learn, Blackboard

• Founder of the DC Continuous Integration, Delivery, and Deployment Meetup

About Me

2

Page 3: Continuous Delivery Applied (Agile Richmond)

…a set of practices and principles aimed at, building, testing, and releasing software faster and more frequently.

3

Continuous Delivery is…

Page 4: Continuous Delivery Applied (Agile Richmond)

4

Page 5: Continuous Delivery Applied (Agile Richmond)

5

Page 6: Continuous Delivery Applied (Agile Richmond)

“Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.”

- First of the Twelve Principles behind the Agile Manifesto

6

Page 7: Continuous Delivery Applied (Agile Richmond)

Quality or Speed

7

Page 8: Continuous Delivery Applied (Agile Richmond)

“How long would it take your organization to deploy a change [to production] that involves just one single line of code? Do you do this on a repeatable, reliable basis?”

- Mary and Tom Poppendieck,Implementing Lean Software Development

8

Cycle Time

Page 9: Continuous Delivery Applied (Agile Richmond)

9

The Last Mile

Manual Deployments

Insufficient Configuration Management

Infrequent, Error Prone Deployments

Page 10: Continuous Delivery Applied (Agile Richmond)

10

Stressful Releases

Page 11: Continuous Delivery Applied (Agile Richmond)

11

Frequent Automated Deployments

http://flic.kr/p/29Ree

Page 12: Continuous Delivery Applied (Agile Richmond)

12

Always Production Ready

Page 13: Continuous Delivery Applied (Agile Richmond)

13

Agile

ConfigurationManagement

Continuous Integration Testing

Deployment Pipelines

Continuous Deployment

Deployment Automation

Page 14: Continuous Delivery Applied (Agile Richmond)

14

Deployment Pipelines

http://www.fotopedia.com/users/chmehl

Page 15: Continuous Delivery Applied (Agile Richmond)

15

Deployment Pipelines

A Deployment Pipeline is an automated manifestation of your process for getting software from version control into the hands of your users.

Page 16: Continuous Delivery Applied (Agile Richmond)

16

Deployment Pipelines(aka Build Pipelines)

Page 17: Continuous Delivery Applied (Agile Richmond)

17

Continuous what?

ContinuousDelivery

ContinuousDeployment

ContinuousIntegration

Page 18: Continuous Delivery Applied (Agile Richmond)

Where do I start?

Page 19: Continuous Delivery Applied (Agile Richmond)

19

Understand your Process

http://www.michaelnygard.com/blog/2008/02/outrunning_your_headlights.html

Page 20: Continuous Delivery Applied (Agile Richmond)

20

Understand your Organization

Page 21: Continuous Delivery Applied (Agile Richmond)

21

Developers

http://flic.kr/p/5cK2

Page 22: Continuous Delivery Applied (Agile Richmond)

22

Test Driven Development

http://reddevnews.com/articles/2007/11/01/testdriven-development-tdd.aspx

Page 23: Continuous Delivery Applied (Agile Richmond)

23

Evolutionary Design

Page 24: Continuous Delivery Applied (Agile Richmond)

24

Automate the Build

Page 25: Continuous Delivery Applied (Agile Richmond)

25

Static Code Analysis

CheckStyle

Page 26: Continuous Delivery Applied (Agile Richmond)

26

Technical Debt

Page 27: Continuous Delivery Applied (Agile Richmond)

27

The Team

Page 28: Continuous Delivery Applied (Agile Richmond)

28

Agile

Page 29: Continuous Delivery Applied (Agile Richmond)

29

Continuous Integration

Page 30: Continuous Delivery Applied (Agile Richmond)

30

Continuous Integration

Check-in Daily

Commit to Trunk

Automate the Build

Keep the Build Fast

Every Commit results in Build

Test in Clone of Production

Automate Deployment

Page 31: Continuous Delivery Applied (Agile Richmond)

31

Build Pipeline in Jenkins

Page 32: Continuous Delivery Applied (Agile Richmond)

32

Testing

Page 33: Continuous Delivery Applied (Agile Richmond)

33

Types of Tests

Page 34: Continuous Delivery Applied (Agile Richmond)

34

Test Strategy

Taken from Growing Object-Oriented Software, Guided by Tests

Page 35: Continuous Delivery Applied (Agile Richmond)

35

Testing is not a Phase

http://flic.kr/p/6bcg

Page 36: Continuous Delivery Applied (Agile Richmond)

36

Specification by Example

Page 37: Continuous Delivery Applied (Agile Richmond)

37

Specification by Example

Page 38: Continuous Delivery Applied (Agile Richmond)

38

Automated Performance Testing

Page 39: Continuous Delivery Applied (Agile Richmond)

39

Configuration Management

Page 40: Continuous Delivery Applied (Agile Richmond)

Version Control

40

Page 41: Continuous Delivery Applied (Agile Richmond)

41

Build Once, Deploy Many

Page 42: Continuous Delivery Applied (Agile Richmond)

Externalize Configuration

42

ESCAPE Database

Page 43: Continuous Delivery Applied (Agile Richmond)

Artifact Repositories

43

Page 44: Continuous Delivery Applied (Agile Richmond)

44

Traceability

Page 45: Continuous Delivery Applied (Agile Richmond)

45

Versioning Numbers

Page 46: Continuous Delivery Applied (Agile Richmond)

Branch by Abstraction

46

Page 47: Continuous Delivery Applied (Agile Richmond)

47

Deploying

Page 48: Continuous Delivery Applied (Agile Richmond)

48

Automated Deployments

Page 49: Continuous Delivery Applied (Agile Richmond)

Code Deployments

49

1. Push New Binary to Server2. Stop Server3. Archive Old Binary4. Deploy New Binary5. Start Server

Page 50: Continuous Delivery Applied (Agile Richmond)

Version your Database

50

Page 51: Continuous Delivery Applied (Agile Richmond)

Database Deployments

51

VersionControl

DBChange

DBChange

DB Change

BuildServer

Production

Test

Dev

.sqlHTML

DBA

Page 52: Continuous Delivery Applied (Agile Richmond)

52

Page 53: Continuous Delivery Applied (Agile Richmond)

DevOps

53

http://www.agileweboperations.com/lean-agile-devops-related

Page 54: Continuous Delivery Applied (Agile Richmond)

DevOps: it’s about culture

54

http://dev2ops.org/2012/10/devops-transformation-workshop-for-technical-managers/

Page 55: Continuous Delivery Applied (Agile Richmond)

Infrastructure as Code

55

Page 56: Continuous Delivery Applied (Agile Richmond)

56

Puppet

Page 57: Continuous Delivery Applied (Agile Richmond)

Vagrant

57

Page 58: Continuous Delivery Applied (Agile Richmond)

58

Monitoring (sucks)

https://github.com/monitoringsucks

Page 59: Continuous Delivery Applied (Agile Richmond)

59

Continuous Deployment

Page 60: Continuous Delivery Applied (Agile Richmond)

60

Contact Me

Mike McGarr

[email protected]

@jmichaelmcgarr

http://earlyandoften.wordpress.com

Page 61: Continuous Delivery Applied (Agile Richmond)

61

Further Reading• Continuous Delivery: Reliable Software Releases through Build, Test

and Deployment Automation, by Jez Humble and David Farley - http://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912

• Continuous Integration, By Paul M Duvall - http://www.amazon.com/Continuous-Integration-Improving-Software-Reducing/dp/0321336380

• Refactoring Databases, By Scott Ambler and Pramod Sadalage - http://www.amazon.com/Refactoring-Databases-Evolutionary-paperback-Addison-Wesley/dp/0321774515

• Refactoring, By Martin Fowler - http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672

• Growing Object-Oriented Software, Guided by Tests, by Steven Freeman and Nat Pryce - http://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627

Page 62: Continuous Delivery Applied (Agile Richmond)

62

Further Reading• Extreme Programming Explained, by Kent Beck -

http://www.amazon.com/Extreme-Programming-Explained-Embrace-Change/dp/0201616416

• Release It!, by Michael Nygard - http://pragprog.com/book/mnee/release-it

• xUnit Test Patterns, by Gerard Meszaros - http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Code/dp/0131495054

• Working Effectively with Legacy Code, by Michael Feathers - http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052

• Agile Testing, by Lisa Crispin and Janet Gregory - http://www.amazon.com/Agile-Testing-Practical-Guide-Testers/dp/0321534468

Page 63: Continuous Delivery Applied (Agile Richmond)

63

Further Reading• Test Driven Development (TDD) –

http://en.wikipedia.org/wiki/Test-driven_development• Introducing BDD, by Dan North – http://dannorth.net/introducing-bdd/• Agile Manifesto – http://agilemanifesto.org/• Scrum – http://www.scrumalliance.org/learn_about_scrum• Continuous Integration, by Martin Fowler –

http://martinfowler.com/articles/continuousIntegration.html• Specification by Example, by Gojko Adzic -

http://specificationbyexample.com/• Build Pipelines -

http://www.magpiebrain.com/2009/12/13/a-brief-and-incomplete-history-of-build-pipelines/

• Implementing Lean Software Development, by Mary and Tom Poppendieck - http://www.amazon.com/Implementing-Lean-Software-Development-Concept/dp/0321437381

Page 64: Continuous Delivery Applied (Agile Richmond)

64

Further Reading• Maven Releases on Steriods, by Axel Fontaine –

http://www.axelfontaine.com/2011/01/maven-releases-on-steroids-adios.html

• What is in a Name? Usually a version number, actually., by James Betteley - http://jamesbetteley.wordpress.com/2011/07/07/what-is-in-a-name-usually-a-version-number-actually/

• Build Once, Deploy Many - http://earlyandoften.wordpress.com/2010/09/09/build-once-deploy-many/

• Evolutionary Design - http://martinfowler.com/articles/designDead.html• Continuous Deployment -

http://timothyfitz.wordpress.com/2009/02/08/continuous-deployment/ • Sonar’s Technical Debt Calculation -

http://www.sonarsource.org/evaluate-your-technical-debt-with-sonar/• Gherkin - https://github.com/cucumber/cucumber/wiki/Gherkin

Page 65: Continuous Delivery Applied (Agile Richmond)

65

Further Reading• Branch by Abstraction, by Paul Hammant

http://paulhammant.com/blog/branch_by_abstraction.html • Making Large Scale Changes Incrementally with Branch by Abstraction,

by Jez Humble - http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/

• What is DevOps?, by Damon Edwards - http://dev2ops.org/2010/02/what-is-devops/

• Monitoring Sucks - https://github.com/monitoringsucks

Page 66: Continuous Delivery Applied (Agile Richmond)

66

Tools• Git - http://git-scm.com/• Subversion - http://subversion.tigris.org/• Mercurial - http://mercurial.selenic.com/• Rational ClearCase -

http://www-01.ibm.com/software/awdtools/clearcase/• Serena Dimensions CM -

http://www.serena.com/products/dimensions-cm/index.html• Ant - http://ant.apache.org/• Ivy - http://ant.apache.org/ivy/• Maven - http://maven.apache.org/• Gradle - http://gradle.org/• JUnit – http://www.junit.org/• Mockito – http://code.google.com/p/mockito/• Hamcrest – http://code.google.com/p/hamcrest/• Spock – http://code.google.com/p/spock/• dbUnit – http://www.dbunit.org/• Unitils – http://unitils.org/summary.html

Page 67: Continuous Delivery Applied (Agile Richmond)

67

Tools• Findbugs – http://findbugs.sourceforge.net/• PMD – http://pmd.sourceforge.net/• Checkstyle – http://checkstyle.sourceforge.net/• JIRA – http://www.atlassian.com/software/jira/overview• GitHub – https://github.com/• Jenkins - http://jenkins-ci.org/• TeamCity – http://www.jetbrains.com/teamcity/• Nexus – http://www.sonatype.org/nexus/• Artifactory – http://www.jfrog.com/products.php• Sonar – http://www.sonarsource.org/• FitNesse – http://fitnesse.org/ • Concordion – http://www.concordion.org/• Cucumber – http://cukes.info/• easyb – http://www.easyb.org/• jBehave - http://jbehave.org/• geb - http://www.gebish.org/

Page 68: Continuous Delivery Applied (Agile Richmond)

68

Tools• Liquibase – www.liquibase.org/ • Flyway – http://code.google.com/p/flyway/• Escape – http://code.google.com/p/escservesconfig/• Capistrano - https://github.com/capistrano/capistrano • Deployinator - https://github.com/etsy/deployinator • Puppet – http://puppetlabs.com/• Chef – http://www.opscode.com/chef/• Ansible - http://ansible.cc/ • Vagrant – http://vagrantup.com/• JMeter – http://jmeter.apache.org/• Nagios - http://www.nagios.org/• Logstash - http://logstash.net/ • StatsD – https://github.com/etsy/statsd • Metrics – http://metrics.codahale.com/ • Ganglia – http://ganglia.sourceforge.net/ • Graphite - http://graphite.wikidot.com/