oa8xlq
Last Updated: February 25, 2016
·
2.288K
· subosito
B8d0a61ecf3b9a23540703024875d7b7

Invoke any rake tasks on capistrano

Add below lines to deploy.rb

namespace :deploy do
  desc "Invoke rake task"
  task :invoke do
    run "cd '#{current_path}' && #{rake} #{ENV['task']} RAILS_ENV=#{rails_env}"
  end
end

Sample usages:

cap deploy:invoke task=db:seed
cap deploy:invoce task=another:rake-task

That's it :)

Say Thanks
Respond