Ruby-on-rails – How to invoke one Capistrano task from another

capistranoruby-on-rails

How do I invoke one Capistrano task from another?

For example:

task :foo do
  # stuff
end

task :bar do
  # INVOKE :foo
end

Best Answer

For the record: in the Capistrano 3, use invoke(), e.g.

desc "Task that does something"
task :do_something do
  invoke 'namespace:task'
end

More at https://github.com/capistrano/capistrano#before--after

Related Topic