A little bit more explicit, in your configdeploy.rb
, add outside any task or namespace:
namespace :rake do
desc "Run a task on a remote server."
# run like: cap staging rake:invoke task=a_certain_task
task :invoke do
run("cd #{deploy_to}/current; /usr/bin/env rake #{ENV['task']} RAILS_ENV=#{rails_env}")
end
end
Then, from /rails_root/
, you can run:
cap staging rake:invoke task=rebuild_table_abc
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…