Babushka

377 views

Published on

Babushka is a lightweight dependency based tool that could help you improve your deployment process.

There are plenty of good dedicated deployment tools out there, but they are often very prescriptive about how your code gets deployed. Can't use SSH or rsync? What happens when you want to deploy to heroku? Rake is fine, but making your deploys robust is a lot of work. Babushka has an elegant solution to this problem, as well as helping to automate other annoying tasks reliably.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
377
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Babushka

  1. 1. Babushka Richard McGain @mcgain richardmcgain.com
  2. 2. the nameBabushka in Russian means "mother" But. . . In Australia, it is the name for Russian Nesting Dolls
  3. 3. the installer .$ sh -c "`curl https://babushka.me/up`"This installs Babushka, ruby and git(if they are not already installed)
  4. 4. the purpose Automates system tasks such as:● Deploys● Setting up your dev box● Other important stuff you dont want screwed up
  5. 5. the basics$ babushka deploy A dependency or "dep"The command
  6. 6. the conceptdep "dep names can have spaces" do met? { return true or false no side effects } meet { do the actual work here }end
  7. 7. the codedep "precompile assets" do met? { File.directory? "public/assets" } meet { `rake assets:precompile` }end
  8. 8. the requiredep "deploy" do requires [ "precompile assets", "push to heroku" ]end
  9. 9. the variables .$ babushka push ref=master remote=origindep "push", :ref, :remote do requires("repo exists").with(remote) `git push #{remote} #{ref}:#{ref}`end
  10. 10. the fileWhere does Babushka look for this dep?./babushka-deps/~/.babushka-deps/ /usr/local/bin/babushka/deps/it looks for all ruby filesrecursively.
  11. 11. the github$ babushka mcgain:deployit clones:github.com/mcgain/babushka-depsthen loads the repo and runs the depWARNING: only do this for deps youtrust
  12. 12. the shellshell "rake annotate"
  13. 13. the shellshell "[ 1 == 0 ]" do |s| if s.result == 1 math_seems_to_work endend
  14. 14. the stdoutAlso stderr!shell "grep" do |s| puts s.stdout #prints nothing puts s.stderr #prints helpful errorend
  15. 15. the cdWe can cdcd "~/.vim/bundle"shell "git clone gh.co/tpope/vim-repo"cd "~/.vim/bundle" do shell "git clone gh.co/vim/plugin"end
  16. 16. the gitdef rails_repo @repo ||= Babushka::GitRepo.new( some-git-repo )endrails_repo.repo_shell "git push"
  17. 17. the methodsThere are some convenience methods: rebasing? current_head branch! checkout! reset_hard! ahead? behind?
  18. 18. the installdep "colors.npm"will install the node package colorsbut if the name doesnt matchdep django.pip do installs Django provides django-admin.pyend
  19. 19. the list.lib for libraries.bin for binaries.gem for gems.py ....npm ...
  20. 20. the rubydep ruby.bin do installs { via [:lenny, :hardy, :lucid], %w[ruby irb ruby1.8-dev] via :apt, %w[ruby ruby1.8-dev] via :yum, %w[ruby ruby-irb] otherwise ruby } provides ruby >= 1.8.6, irbend
  21. 21. the versionsdep postgres.bin do installs postgresql provides psql ~> 9.0.0end
  22. 22. the integration .Although it is a standalone tool it isalso a library (with / without DSL )Babushka does not scale, 1 system onlyChef, Capistrano, Vagrant, Puppet allsolve a slightly different problem andare complementary.
  23. 23. the futuregoogle for:site:github.com babushka-deps Questions? Richard McGain @mcgain richardmcgain.com

×