Skip to content

Instantly share code, notes, and snippets.

@rlivsey
Created July 21, 2010 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rlivsey/484858 to your computer and use it in GitHub Desktop.
Save rlivsey/484858 to your computer and use it in GitHub Desktop.
namespace :vlad do
desc "installs Bundler if it is not already installed"
remote_task :install_bundler do
run "sh -c 'if [ -z `which bundle` ]; then echo Installing Bundler; sudo gem install bundler; fi'"
end
desc "symlink bundle directory and write config"
remote_task :setup_bundler do
run "ln -s #{shared_path}/bundle #{latest_release}/bundle"
run "mkdir -p #{latest_release}/.bundle"
run "cp #{shared_path}/bundle_config #{latest_release}/.bundle/config"
run "cp #{shared_path}/Gemfile.lock #{latest_release}/Gemfile.lock"
end
desc "run 'bundle install' to install Bundler's packaged gems for the current deploy and cache the config and lock files for the next releases"
remote_task :bundle_install do
run "cd #{latest_release} && bundle install #{shared_path}/bundle --without development test"
run "cp #{latest_release}/bundle_config #{shared_path}/.bundle/config"
run "cp #{latest_release}/Gemfile.lock #{shared_path}/Gemfile.lock"
end
end
task :quick_deploy => [ "vlad:update",
"vlad:setup_bundler",
"vlad:start_app" ]
task :deploy => [ "vlad:update",
"vlad:setup_bundler",
"vlad:install_bundler",
"vlad:bundle_install",
"vlad:start_app",
"vlad:cleanup" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment