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

Continuous Delivery at GitHub

Df5e7adb20adae6c120b04e7cafb15a0?s=47 Rob Sanheim
September 18, 2014

Continuous Delivery at GitHub

Df5e7adb20adae6c120b04e7cafb15a0?s=128

Rob Sanheim

September 18, 2014
Tweet

Transcript

  1. ! Continuous Delivery at GitHub @rsanheim

  2. ! @rsanheim

  3. None
  4. ! What is Continuous Delivery?

  5. ! Software ready to be deployed at any time

  6. ! Why should we care?

  7. !

  8. None
  9. ! Besides… Shipping is fun

  10. ! Releases and cycle time

  11. Releases over one year Release 1 Build Test Deploy Bugs

    Change Requests Release 2 Build Test, Perf, Scaling Deploy Support Requests Complaints QA Revenue $$
  12. Releases over half a year Build Deploy Bugs Issues Team

    Feedback Build & Scale Deploy Bugs Perf Staff Feedback Build Deploy Bugs Genpop Feedback Polish Deploy Bugs Genpop Feedback Polish Deploy Profit - Done!
  13. ! How?

  14. ‣ Automation ‣ Tests ‣ Pull Requests ‣ Feature Flags

    ‣ Chat Ops ‣ Post Deploy
  15. ! Automation

  16. https://www.flickr.com/photos/nasamarshall/5390879521

  17. ! Tests

  18. ! SLOC! ! ! ! Directory! ! 60995 test/models! 34526

    test/integration! 31106 test/controllers! 25339 test/lib! 12440 test/view_models! 1423 test/jobs! 1029 test/mailers! ! ! ! ruby test loc: 167k! ruby app loc: 158k! ! test / app ratio: 1.06! ! ! generated using David A. Wheeler's 'SLOCCount'
  19. ! Pull Requests

  20. !

  21. None
  22. None
  23. ! Feature Flags

  24. def live_updates_enabled? logged_in? && current_user.staff? end

  25. <% if live_updates_enabled? %> <div class="js-live-update" data-url="<%= live_update_url %>"> <!--

    more pull request template code here ... --> </div> <% end %>
  26. def live_updates_enabled?! true! end!

  27. ! git co master

  28. ! Long lived branches are a smell

  29. ! Rails 3

  30. ! rails3-redux

  31. ! rails3-redux master

  32. ! ! ! $ RAILS3=true script/bootstrap Bootstrapping the Rails 3

    gem environment… ! $ script/bootstrap Bootstrapping the Rails 2 gem environment…
  33. ! source "https://rubygems.org" ! def rails3? ENV["RAILS3"] end ! if

    rails3? gem "rails", "3.0.20.github11" else gem "rails", "2.3.14.github50" gem "actionmailer", "2.3.14.github50" gem "actionpack", "2.3.14.github50" gem "activerecord", "2.3.14.github50" gem "activesupport", "2.3.14.github50" end ! gem "will_paginate", rails3? ? "3.0.3" : "2.3.9.github"
  34. ! ! # Disable plugins on Rails 3 GitHub.only_on_rails_3 do

    config.plugins = [] end ! # Rails 2 needs the session to be configured before initializing GitHub.only_on_rails_2 do require_relative "initializers/session_store" end
  35. ! science

  36. ! https://github.com/github/dat-science

  37. ! require "dat/science" ! class User include Dat::Science ! def

    can_read?(model) science "user-can-read" do |e| e.context :caller => caller, :login => login e.enabled { self.id % 3 == 0 } e.control { model.readable_by?(user) } # old way e.candidate { self.can?(:read, model) } # new way end end end
  38. ! Chat Ops

  39. !

  40. ! /deploy github/my-feature to production /deploy github/my-feature to branch-lab /deploy

    github/my-feature to production/fe1,fe2,fe3 /deploy github to production /ci build github/master /queue me for github
  41. None
  42. ! Post deploy

  43. None
  44. None
  45. None
  46. ! Done yet?

  47. !

  48. None
  49. ! Collect Feedback …and act on it

  50. ! Getting started today

  51. ! Fin

  52. ! More adaptable

  53. ! More flexible

  54. ! More money

  55. ! More fun

  56. ! Thank You