部署后重新加载capistrano,但如果Gemfile已更改,则重新启动

时间:2019-05-16 11:19:19

标签: ruby-on-rails capistrano bundler production-environment

我正在使用Capistrano + Capistrano :: Bundler,在部署应用程序后,我用以下命令重新加载独角兽:

after :finished, :reload_unicorns do
  on roles(:app) do
    execute '/usr/bin/sudo /bin/systemctl reload app.service'
  end
end

我的systemd服务重新加载如下:

ExecStart=/usr/local/bin/bundle exec "unicorn_rails -D -c config/unicorn.conf.rb -E production"
ExecStop=/bin/kill -s SIGQUIT $MAINPID 
# USR2 signal will spawn the new master process, the kill signal to the old master should be send from rails
ExecReload=/bin/kill -s SIGUSR2 $MAINPID

它运行良好,可以在不停机的情况下重新加载应用程序,但是当我更新Gemfile时,它需要重新启动而不是重新加载,capistrano可以在Gemfile更改时自动重新启动吗?

0 个答案:

没有答案
相关问题