我的deploy.rb
中有以下内容:
after "deploy:update_code", "sphinx:stop"
after "deploy:migrate", "sphinx:start"
通常,当我发出cap
命令时,有时更改不需要deploy:migrate
,而是作为最终命令转到deploy:restart
。因此,sphinx:start
未发布,我不得不手动重启Sphinx。
我本可以这样做:
after "deploy:update_code", "sphinx:stop"
after "deploy:migrate", "sphinx:start"
after "deploy:restart", "sphinx:start"
但我不想这样做,因为如果需要deploy:migrate
并发出,Sphinx将会启动两次。什么应该是正确的命令行?或者也可以将deploy:migrate
替换为deploy:restart
?
after "deploy:update_code", "sphinx:stop"
after "deploy:restart", "sphinx:start"
答案 0 :(得分:1)
after "deploy:update_code", "sphinx:stop"
after "deploy:restart", "sphinx:start"
这很有用。