Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Continuous Integration Brown Bag

Continuous Integration Brown Bag

Slides from a brown bag session I ran on Continuous Integration.
Live demo uses this repo: https://bitbucket.org/clarenceb/cdtt-ci-brownbag

Clarence Bakirtzidis

June 18, 2013
Tweet

More Decks by Clarence Bakirtzidis

Other Decks in Programming

Transcript

  1. Overview What is CI? Benefits of CI How to start

    doing CI Live Demo Tips for Success Wednesday, 19 June 13
  2. What is CI? Continuous Integration = CI "The aim of

    Continuous Integration is that the software is in a working state all the time" [1] What type of “software” are we talking about? CI helps avoid “integration hell” “Bring the pain forward” [1] Continuous Delivery (book), Jez Humble & David Farley Wednesday, 19 June 13
  3. What is CI? [cont.] With CI: Your software is proven

    to work with every change (assuming sufficiently comprehensive automated test suite) Without CI: Your software is broken until someone proves it works, usually during a testing or (typically late) integration stage Wednesday, 19 June 13
  4. Benefits of CI Reduced integration time and cost Reduced delivery

    risks Improved and shorter feedback cycles Improved team communication Improved software quality Wednesday, 19 June 13
  5. Benefits of CI [cont.] Having a comprehensive automated test suite

    supports TDD (fast feedback) and refactoring Early warning system for issues Visibility of the health and production readiness of the software outside of the team Wednesday, 19 June 13
  6. How to start doing CI Pre-requisites: Version Control, Automated Build,

    Agreement of the team, CI Server (optional but highly recommended) Start simple - automate build, add some automated tests, incremental improvements Make sure everyone understands the CI process, scripts and how to run them Wednesday, 19 June 13
  7. How to start doing CI Put everything required to build

    and test your software in source control Start building a CI server to run your build, tests, package, etc, on every commit Advanced CI: Build and Test Everything: Code + Configuration + Infrastructure changes Typical day-to-day Developer CI scenario... Wednesday, 19 June 13
  8. CI Stages Commit stage Compile Unit test Assemble Code analysis

    source code commit tests build scripts deployable binaries test reports metadata Version control Artifact repository Acceptance test stage Configure environment Deploy and smoke test Acceptance test Tear down acceptance tests deployment scripts configuration data test reports metadata Version control Artifact repository binaries Artifact repository Images from “Continuous Delivery” (book) by Jez Humble & David Farley Wednesday, 19 June 13
  9. Manual Stages Later stages Configure environment Deploy and smoke test

    Tear down on request deployment scripts configuration data test reports metadata Version control Artifact repository binaries Artifact repository Image from “Continuous Delivery” (book) by Jez Humble & David Farley Wednesday, 19 June 13
  10. But what about... Scheduled builds vs. build on every commit?

    Branching vs Mainline: Good or Evil? Changes that are not ready for use? Off-the-shelf packages? Distributed teams? Large projects? Wednesday, 19 June 13
  11. P1 P2 G2 G3 G1 G4 P3 P4 P5 G5

    G6 B1 B2 G1 G1 P1 P1 B1 P2 B1 P1-2 G2 G2 P3 G2 P3 B2 P4 B2 G3 P3 G3 G3 P4 P4 P5 P4-5 G4 G4 G5 G6 P2 Professor Plum Reverend Green Mainline Continuous Integration Wednesday, 19 June 13
  12. P1 P2 G2 G3 G1 G4 P3 P4 P5 G5

    G6 B1 B2 G1 G1 P1 P1 B1 P2 B1 P1-2 G2 G2 P3 G2 P3 B2 P4 B2 G3 P3 G3 G3 P4 P4 P5 P4-5 G4 G4 G5 G6 P2 Professor Plum Reverend Green Mainline P1 P2 G2 G1 B1 B1 B1 P1-2 G1-2 G3 G4 P4 B2 P5 G5 G6 B2 P3-4 G3 B2 P3 Professor Plum Reverend Green Mainline G1-6 P1-5 P1-5 G1-6 Continuous Integration Feature Branch Wednesday, 19 June 13
  13. Tips for Success Checkin regularly - Everyone commits to the

    mainline every day Create a comprehensive automated test suite Keep the commit stage fast Make the build visible (dashboards, build lights) Automate the build (run it on a CI server) Wednesday, 19 June 13
  14. Tips for Success [cont.] Agree on build hygiene and responsibilities

    Don't checkin on a broken build Take responsibility for all breakages that result from your changes Every commit to mainline should be automatically tested Don't comment out failing tests Wednesday, 19 June 13
  15. References Continuous Integration Martin Fowler http://www.martinfowler.com/articles/continuousIntegration.html Continuous Delivery Chapter 3

    - Continuous Integration, Jez Humble and David Farley, C. 2011 Pearson Education, Inc. Continuous Integration Wikipedia http://en.wikipedia.org/wiki/Continuous_integration Wednesday, 19 June 13
  16. Next Steps Books Continuous Delivery, Jez Humble & David Farley

    Continuous Integration, Paul M. Duvall Internet Resources "Continuous Integration is an Attitude, Not a Tool" (http:// www.jamesshore.com/Blog/Continuous-Integration-is-an- Attitude.html) Wednesday, 19 June 13
  17. Credits Slides 10, 14, 15, 16 - Tom Sulston (@tomsulston),

    ThoughtWorks, from his presentation Slides 11, 12 - Images are from the “Continuous Delivery” book by Jez Humble & David Farely Other photo credits are indicated on the slides where they are used Wednesday, 19 June 13