Skip to content

Commit

Permalink
Run any rake task on remote
Browse files Browse the repository at this point in the history
  • Loading branch information
stoivo committed Sep 19, 2017
1 parent 62b795f commit 0772140
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
11 changes: 11 additions & 0 deletions lib/capistrano/tasks/migrations.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0772140

Please sign in to comment.