fd6png
Last Updated: February 19, 2017
·
979
· tmartin314
Fisheye

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
Say Thanks
Respond

1 Response
Add your response

26712
Fisheye

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 ·