How do I invoke one Capistrano task from another?

后端 未结 5 1623
走了就别回头了
走了就别回头了 2021-02-03 17:38

How do I invoke one Capistrano task from another?

For example:

task :foo do
  # stuff
end

task :bar do
  # INVOKE :foo
end
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-03 18:20

    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.

提交回复
热议问题