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.
9. the variables .
$ babushka push ref=master remote=origin
dep "push", :ref, :remote do
requires("repo exists").with(remote)
`git push #{remote} #{ref}:#{ref}`
end
10. the file
Where does Babushka look for this dep?
./babushka-deps/
~/.babushka-deps/
/usr/local/bin/babushka/deps/
it looks for all ruby files
recursively.
11. the github
$ babushka mcgain:deploy
it clones:
github.com/mcgain/babushka-deps
then loads the repo and runs the dep
WARNING: only do this for deps you
trust
15. the cd
We can cd
cd "~/.vim/bundle"
shell "git clone gh.co/tpope/vim-repo"
cd "~/.vim/bundle" do
shell "git clone gh.co/vim/plugin"
end
16. the git
def rails_repo
@repo ||= Babushka::GitRepo.new(
'some-git-repo'
)
end
rails_repo.repo_shell "git push"
17. the methods
There are some convenience methods:
rebasing?
current_head
branch!
checkout!
reset_hard!
ahead?
behind?
18. the install
dep "colors.npm"
will install the node package colors
but if the name doesn't match
dep 'django.pip' do
installs 'Django'
provides 'django-admin.py'
end
19. the list
.lib for libraries
.bin for binaries
.gem for gems
.py ...
.npm ...
20. the ruby
dep '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', 'irb'
end
22. the integration .
Although it is a standalone tool it is
also a library (with / without DSL )
Babushka does not scale, 1 system only
Chef, Capistrano, Vagrant, Puppet all
solve a slightly different problem and
are complementary.