Created
May 8, 2015 00:43
-
-
Save monkseal/d50779f698856eefe3a4 to your computer and use it in GitHub Desktop.
Invoke a rake task from capistrano 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :deploy do | |
# .... | |
# @example | |
# bundle exec cap uat deploy:invoke task=users:update_defaults | |
desc 'Invoke rake task on the server' | |
task :invoke do | |
fail 'no task provided' unless ENV['task'] | |
on roles(:app) do | |
within release_path do | |
with rails_env: fetch(:rails_env) do | |
execute :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