Capistrano 3 invoke rake task remotely
Added to the deploy namespace:
# @example
# bundle exec cap staging deploy:invoke task=salesforce:sync_accounts
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
Written by Troy Martin
Related protips
1 Response
There may be a plugin for this, but I wasn't able to find one. Maybe someone can make one? (I don't know how)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#