Capistrano跳过部署:迁移

时间:2010-11-19 02:42:06

标签: ruby-on-rails sphinx capistrano

我的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"

1 个答案:

答案 0 :(得分:1)

after "deploy:update_code", "sphinx:stop"
after "deploy:restart", "sphinx:start"

这很有用。