Capistrano 跳过部署:迁移

发布于 2024-10-03 06:16:49 字数 730 浏览 4 评论 0原文

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

I have the following in my deploy.rb:

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

Often when I issue a cap command, sometimes the changes don't require a deploy:migrate, and went to deploy:restart as its final command. Hence, sphinx:start was not issued and I had to restart Sphinx manually.

I could have done this:

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

But I don't wanna do this because if a deploy:migrate is required and issued, Sphinx would be started twice. What should be the proper command line? Or might as well just replace deploy:migrate with deploy:restart?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

但可醉心 2024-10-10 06:16:49
after "deploy:update_code", "sphinx:stop"
after "deploy:restart", "sphinx:start"

这奏效了。

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

This worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文