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

How we use GitHub to continuously integrate GitHub

Ben Lavender
June 20, 2014
120

How we use GitHub to continuously integrate GitHub

Ben Lavender

June 20, 2014
Tweet

Transcript

  1. How we use
    A love story
    to continuously integrate

    View Slide

  2. This talk is:
    • 3 stories

    • Selling you on GitHub’s workflow

    • Helping you believe you can do it

    View Slide

  3. Hi, I’m @bhuga
    I work on workflow
    I work at GitHub
    I’m @bhuga everywhere

    View Slide

  4. My first day at GitHub
    Story 1
    My Story, My life
    A tear-jerking coming-of-age story about

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. GitHub Flow

    View Slide

  9. The Rules
    • Anything on master is deployable. And will be. Like right now.

    • Work off of short-lived named branches

    • Open a pull request for help, feedback, and signoff

    • Once you merge, deploy immediately.

    View Slide

  10. Do work on a branch
    Decide what's worth
    doing
    Automated tests
    Deploy to production
    Merge to master
    Manual tests
    auto-deploy
    feedback
    feedback
    feedback
    SCRUM or
    whatever

    View Slide

  11. My Story, My life
    An inspiring autobiography of hope by
    A Fix at GitHub
    Names have been changed to protect the innocent
    Story 2

    View Slide

  12. Step 1: Decide what to do
    Step 1: Decide what to do

    View Slide

  13. Step 1: Decide what to do

    View Slide

  14. Step 2: Do it

    View Slide

  15. Step 2: Do it

    View Slide

  16. Step 2: Do it
    git push

    View Slide

  17. ASYNCHRONO
    USLY
    • Not at the same time

    • At your leisure

    • When it’s not interrupting people

    View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. View Slide

  37. GitHub Flow

    View Slide

  38. GitHub Flow
    is a version of
    Continuous Deployment

    View Slide

  39. • Techniques such as automated testing,
    continuous integration and continuous
    deployment allow software to be
    developed to a high standard and easily
    packaged and deployed to test
    environments, resulting in the ability to
    rapidly, reliably and repeatedly push out
    enhancements and bug fixes to
    customers at low risk and with minimal
    manual overhead.
    Professor Wikipedia says:

    View Slide

  40. …boring
    Continuous deployment is about
    developing and deploying in short,
    rapid increments.

    View Slide

  41. Benefits for Developers:
    • A simple, easy-to-learn workflow

    • No release process

    • Frequent feedback

    • Low-risk, low-stress ships

    • Merge conflicts become trivial

    • Ownership, agency, quick wins, and responsibility

    View Slide

  42. My Life, My Story
    How I got from where you are to continuous deployment
    A drama
    Story 3

    View Slide

  43. My Life, My Story
    How I got from where you are to continuous deployment
    A drama
    Story 3
    Starring
    You

    View Slide

  44. My Life, My Story
    How I got from where you are to continuous deployment
    A drama
    Story 3
    Starring
    You
    And Jackie Chan

    View Slide

  45. Practices
    Part 1

    View Slide

  46. Make
    TINY
    changes

    View Slide

  47. View Slide

  48. Help your application

    understand
    development

    View Slide

  49. • Feature flags

    View Slide

  50. View Slide

  51. View Slide

  52. Use

    feature

    flags

    to make ships smaller and safer

    View Slide

  53. View Slide

  54. View Slide

  55. • Feature flags

    View Slide

  56. Tools
    Part 2

    View Slide

  57. Chat
    Chat.

    chat, chat, chat, chat, chat, chat.

    With a robot.

    View Slide

  58. Shared Console
    • /deploy

    • /ci build

    • /merge

    • /config

    View Slide

  59. Exceptions

    View Slide

  60. Graphs

    View Slide

  61. View Slide

  62. View Slide

  63. Hackable toolchain

    View Slide

  64. CD needs to be automated
    • Builds on every commit

    • Results of signoff (feedback)

    • Deployment

    • Setup for manual tests

    • Communication

    View Slide

  65. Implement on
    new branch
    Run build
    Communicate
    Build status
    Respond to build
    issues
    Create pull
    request (request
    feedback)
    Communicate
    ready for
    feedback
    Review
    Communicate
    review
    Respond to
    review
    signoff
    branch deploy
    Test in
    production
    Fix issues
    Re-deploy
    branch
    Merge branch
    integrate master
    Deploy master !
    integrate master

    View Slide

  66. Implement on
    new branch
    Run build
    Communicate
    Build status
    Respond to build
    issues
    Create pull
    request (request
    feedback)
    Communicate
    ready for
    feedback
    Review
    Communicate
    review
    Respond to
    review
    signoff
    branch deploy
    Test in
    production
    Fix issues
    Re-deploy
    branch
    Merge branch
    integrate master
    Deploy master !
    integrate master

    View Slide

  67. VCS server
    (GitHub)
    Webhook
    Receiver
    HTTP POST
    WebHooks

    View Slide

  68. VCS server
    (GitHub)
    Git push
    Webhook
    Receiver
    Commit Info

    View Slide

  69. Disclaimer

    View Slide

  70. • Gerrit - https://github.com/jtolds/gerrit-webhooks

    • Stash - https://marketplace.atlassian.com/plugins/
    com.atlassian.stash.plugin.stash-web-post-receive-hooks-plugin

    • Bitbucket - https://confluence.atlassian.com/display/BITBUCKET/
    POST+hook+management

    View Slide

  71. VCS server
    (GitHub)
    Git push
    Webhook
    Receiver
    Issue Assigned
    HTTP POST
    Repository
    Starred
    Pull Request
    Opened
    Tests Failed

    View Slide

  72. GitHub Events
    • There’s a ton

    View Slide

  73. GitHub Events
    • There’s a ton

    View Slide

  74. GitHub Events
    • There’s a ton

    View Slide

  75. View Slide

  76. View Slide

  77. Example: Announce Issue Creation

    View Slide

  78. Announce Issue Creation
    Developer GitHub
    Webhook
    Receiver
    Create Issue
    Issue Event

    View Slide

  79. View Slide

  80. View Slide

  81. Example: Build Every Commit

    View Slide

  82. View Slide

  83. View Slide

  84. Build Every Commit
    Developer GitHub CI Server
    Commit
    Push Event
    Build Starts
    Update Status - Pending
    Update Status - Success
    Notifications

    View Slide

  85. View Slide

  86. Example: Deployment

    View Slide

  87. View Slide

  88. View Slide

  89. View Slide

  90. Deployment
    Developer GitHub Deploy Server
    Create Deployment
    Deployment Event
    Deploy Starts
    Deployment Status - Started
    Deployment Status - Finished
    Notifications

    View Slide

  91. Example: Signoff

    View Slide

  92. View Slide

  93. View Slide

  94. Signoff
    Developer GitHub QA Team
    Create pull request
    Notification
    Testing
    Comment !
    Notifications
    Issue Comment Webhook
    Deployment
    Server
    Close
    Deploy
    Comment

    View Slide

  95. View Slide

  96. 198 API
    Endpoints

    View Slide

  97. Buy instead of Build?
    • github/hubot - Chat robot. http://ciel.im/2013/11/21/hubot-heroku-hipchat/

    • atmos/heaven - GitHub-style deployments to Heroku

    • github/janky - Hubot integration for Jenkins

    • Travis CI, Circle CI, Codeship, many more - CI/CD as a service

    • travis-ci/dpl - Library for deploying to a number of providers

    • sprint.ly - GitHub-integrated sprinting

    View Slide

  98. View Slide

  99. Dziękuję!
    questions?

    View Slide