Restart Unicorn issue (capistrano)

前端 未结 3 560
有刺的猬
有刺的猬 2020-12-13 11:47

I\'ve got following settings in deploy.rb to restart my server:

namespace :deploy do
  task :restart do
    run \"if [ -f #{unicorn_pid} ] &&         


        
3条回答
  •  执念已碎
    2020-12-13 12:17

    You should give capistrano-unicorn a try, that's what I currently use with the default hooks mentioned below.

    Setup

    Add the library to your Gemfile:

    ruby group :development do gem 'capistrano-unicorn', :require => false end

    And load it into your deployment script config/deploy.rb:

    ruby require 'capistrano-unicorn'

    Add unicorn restart task hook:

    ruby after 'deploy:restart', 'unicorn:reload' # app IS NOT preloaded after 'deploy:restart', 'unicorn:restart' # app preloaded after 'deploy:restart', 'unicorn:duplicate' # before_fork hook implemented (zero downtime deployments)

提交回复
热议问题