diff --git a/CHANGELOG.md b/CHANGELOG.md index 672a063..e8a8f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # [master][] * Your contribution here! +* [#209](https://github.com/capistrano/rails/pull/209): Run any rake task on remote - [@stoivo](https://github.com/stoivo) # [1.3.0][] (Jun 9 2017) diff --git a/lib/capistrano/tasks/migrations.rake b/lib/capistrano/tasks/migrations.rake index 23cc048..f3bfc9e 100644 --- a/lib/capistrano/tasks/migrations.rake +++ b/lib/capistrano/tasks/migrations.rake @@ -29,6 +29,17 @@ namespace :deploy do end after 'deploy:updated', 'deploy:migrate' + + desc 'Runs any rake task, cap deploy:rake task=db:rollback' + task rake: [:set_rails_env] do + on fetch(:migration_servers) do + within release_path do + with rails_env: fetch(:rails_env) do + execute :rake, ENV['task'] + end + end + end + end end namespace :load do