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

Deliver

 Deliver

As a developer, your job does not stop with writing clean, well-documented and well-tested code. You get paid for working, in production code. So how do you consistently deliver your code into production? How you make it part of your CI process? Does devops do it for you via Chef or Puppet?

This talk is meant to explore the current deployment processes, present their strengths and weaknesses and provide a simple alternative. This alternative has no dependencies (no, not even Ruby) and can be applied in the same way to your trusted Rails, the hated PHP or your look-ma-no-tests node.js.

Video: http://www.youtube.com/watch?v=dzI8M-H3F08

6e1b896f6c4807aa4223acc428c57760?s=128

Gerhard Lazu

March 11, 2013
Tweet

Transcript

  1. DELIVER @gerhardlazu LRUG 03.2013

  2. GIT-DEPLOY CAPISTRANO VLAD MINA FABRIC ASGARD CHEF PUPPET puppi GIT-DEPLOY

    application RECAP
  3. BACK TO BASICS git ssh foreman bash WE ARE A

    UNIX SHOP, EVERYTHING ELSE IS JUST A DETAIL
  4. DO ONE THING DO IT TO THE BEST OF YOUR

    ABILITIES
  5. SMALL IS BEAUTIFUL SIMPLICITY OVER PERFECTION

  6. .deliver/config 1 #!/usr/bin/env bash 2 3 $APP="foo" 4 $HOSTS="foo.1 foo.2"

    5 $PORT="5000" 6 7 post_launch() { 8 notify_newrelic_of_deployment 9 clean_static_cache 10 }
  7. PROBLEM FOCUS ON THE

  8. $ deliver check ORIGIN_DIR /Users/gerhard/code/foo STRATEGY ruby HOSTS foo.1 foo.2

    ----------------------------------------------------------- APP foo APP_USER foo DELIVER_TO ~foo/app REFSPEC master GIT_PUSH -f REVISION f80584aa195479eaa613aa2f5900009188 PORT 5000 SUPERVISOR upstart READY TO DELIVER!
  9. MODES COMPACT verbose debug plain

  10. $ deliver DELIVERING FOO WITH RUBY STRATEGY -----> Authorizing hosts

    -----> Ensuring hosts are ready to accept git pushes -----> Pushing new commits with git to: foo@foo.1 foo@foo.2 -----> Resetting remote hosts to f80584aa195479eaa613aa2f590 -----> Updating git submodules -----> Installing gems with bundler -----> Exporting services to upstart -----> Launching app with upstart -----> Notifying New Relic of new deployment FOO DELIVERED!
  11. ruby STRATEGIES node.js shared generated gh-pages S3

  12. strategies/ruby 1 run() { 2 authorize_hosts 3 init_app_remotely 4 git_push

    5 git_reset_remote 6 authorize_remote_hosts 7 git_submodules 8 rvmrc_trust 9 bundle_install 10 foreman_export 11 launch 12 }
  13. HOOKS init_app_remotely git_push git_submodules bundle_install foreman_export launch

  14. .deliver/config 1 #!/usr/bin/env bash 2 3 $APP="foo" 4 $HOSTS="foo.1 foo.2"

    5 $PORT="5000" 6 7 post_launch() { 8 notify_newrelic_of_deployment 9 clean_static_cache 10 }
  15. CONTINUOUS DELIVERY RELIABLY RELEASING HIGH-QUALITY SOFTWARE QUICKLY CONTINUOUS INCREMENTAL CHANGES

    WITH MINIMAL RISK
  16. bin/build 1 #!/usr/bin/env bash 2 3 # functions 4 5

    setup_dependencies 6 run_tests 7 tag_for_deploy 8 use_compiled_assets 9 _deliver
  17. Gerhard L. hubot deliver foo foo.1

  18. PRODUCTION IF IT’S NOT IN PRODUCTION, IT’S INVENTORY

  19. DELIVER, BE HAPPY! QUESTIONS @gerhardlazu LRUG 03.2013