Skip to content

Instantly share code, notes, and snippets.

@Archimidis
Created November 6, 2013 10:26
Show Gist options
  • Save Archimidis/7333913 to your computer and use it in GitHub Desktop.
Save Archimidis/7333913 to your computer and use it in GitHub Desktop.
Capistrano recipe for remote rake invocation.
namespace :remote_rake do
desc 'Run a task on a remote server.'
# run like: cap remote_rake:invoke task="db:reset"
task :invoke do
run("cd #{deploy_to}/current && bundle exec rake #{ENV['task']} RAILS_ENV=#{rails_env}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment