如何从另一个调用Capistrano任务?
问题描述:
如何从另一个调用Capistrano任务?
How do I invoke one Capistrano task from another?
例如:
task :foo do
# stuff
end
task :bar do
# INVOKE :foo
end
答
您可以通过使用命名空间来实现:
You can do it by using namespace:
namespace :test do
task :one do
end
task :two do
test.one
#or just directly call it:
one
end
end
请小心使用不要覆盖某些重要功能的名称。
Just be careful with the name you use to not overwrite some important function.