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

Capistrano for non-Rubyists

Capistrano for non-Rubyists

Ca017edd68f0d216c4761445bf9f28e7?s=128

Dimitris Tsironis

March 18, 2013
Tweet

Transcript

  1. CAPISTRANO fo non-Rubyist

  2. who we are Dimitris Tsironis Dr. John Pagonis Dr. John

    Pa onis is onto somethin with Missum these days. You can follow him at @JohnPa onis and @MissumApp Founder at Geembo, UI desi ner & hu e eek, who loves ood desi n and french fries, as much as ood indentation in a stylesheet. Follow him @tsironakos and @ eemboHQ
  3. WHAT’S THE PROBLEM? deploys can be a real mess mistakes

    could happen very easily you don’t mess with the production you’re actually delayin bu fixes, new features etc.
  4. one-click deploys! (well, almost)

  5. is a lan ua e agnostic tool for remote application

    administration tasks heavily used by Rails community it’s for sysadmins and devops uys it fits well with deployin web-apps provisionin of infrastructure better handled with other tools, e . Chef, Puppet, Babushka
  6. how it works unde the bo et

  7. philosophy it runs on your computer connects to the server

    over ssh there is no Capistrano server or sth like that automates the tasks you would manually do with command-line
  8. philosophy part ii uses a Ruby-based DSL for task automation

    there are already ready-to-use tasks cap shell offers an interactive prompt for adhoc commands cap shell sessions are cached and can be reused
  9. built-in tasks It ships with plenty of stuff, by default

  10. ready-to-use recipes You can find plenty on Github https://github.com/nesquena/cap-recipes Ruby

    setup & RubyGems mana ement Apache & Phusion Passen er Aptitude mana ement Mon oDB and much more!
  11. custom tasks Tailor-made Capistrano tasks are easy. It’s all Ruby

    and Rake-like tasks, after all.
  12. how to set it up prepare fo the ba le

  13. set it up you need a Capfile in the root

    of the project then, you can execute capistrano tasks anywhere in your project’s folder, by runnin : cap <task name>
  14. rails-less deploy example

  15. capify Capify is a file enerator for your project usually

    used with Rails project but it works with other projects in eneral, it can be enhanced to work with other structures
  16. capify One command to enerate the files Files you need

    Capfile - basic Capistrano file in root of the project config/deploy.rb - here’s where you write custom tasks
  17. production or staging confi /deploy/production.rb confi /deploy/sta in .rb

  18. roles allow you to write capistrano tasks that only apply

    to certain servers then you can do somethin like this
  19. configuration example confi /deploy.rb

  20. custom tasks example confi /deploy.rb

  21. RAILS-specific magic task fo Ruby on Rail only

  22. asset precompile PROBLEM Asset precompile can be slow. It could

    take several minutes that we could use to make a coffee or watch some cats ifs
  23. asset precompile solution Skip precompile, if it isn’t necessary “The

    ability to destroy a planet is insignificant next to the power of Git” --a tech-savvy Darth Vader
  24. rails-specific magic confi /deploy.rb Source: StackOverflow of course!

  25. RESOURCES Deployin with Capistrano - Github Help https://help. ithub.com/articles/deployin -with-capistrano

    Capistrano Wiki https:// ithub.com/capistrano/capistrano/wiki Capistrano Multista e extension https:// ithub.com/capistrano/capistrano/wiki/2.x-Multista e-Extension Capistrano Handbook - still immature https:// ithub.com/leehambley/capistrano-handbook/blob/master/ index.markdown Capistrano Goo le Group http:// roups. oo le.com/ roup/capistrano
  26. thank you! @JohnPa onis @tsironakos @ eemboHQ