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 :)
Written by Alif Rachmawadi
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#