Skip to content

Instantly share code, notes, and snippets.

@Willianvdv
Created July 1, 2014 11:45
Show Gist options
  • Save Willianvdv/6ecb6537c4cd9b88ab58 to your computer and use it in GitHub Desktop.
Save Willianvdv/6ecb6537c4cd9b88ab58 to your computer and use it in GitHub Desktop.
Execute remote task with Capistrano 3
# Usage: bundle exec cap staging execute:rake task=db:migrate
namespace :execute do
task :rake do
on roles(:all) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, "exec rake #{ENV['task']}"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment