Contains a namespace with methods for administrating the unicorn server through capistrano recipes.
This gem is composed from the gems capistrano-unicorn-methods and capistrano-unicorn. It is roughly the structure of capistrano-unicorn-methods with clever ideas from capistrano-unicorn.
gem 'simple-capistrano-unicorn'You should add this line to your Capfile:
require 'capistrano/simple-capistrano-unicorn'You should place this line in PROJECT_ROOT/config/deploy.rb:
after 'deploy', 'unicorn:restart'Grab the sample Unicorn configuration here: https://github.com/kaspergrubbe/simple-capistrano-unicorn/blob/master/configs/unicorn.conf.rb
And place it here: PROJECT_ROOT/config/unicorn.rb change the app_dir variable to suit your configuration.
Go through the setup and run: cap production deploy
The gem gives you access to the following tasks:
unicorn:startstarts the Unicorn processesunicorn:stopstops the Unicorn processesunicorn:restartmakes a seamless zero-downtime restartunicorn:hard_restartbasically runsunicorn:stopfollowed with aunicorn:start
unicorncapistrano
You can customize the gems behavior by setting any (or all) of the following options within capistrano's configuration:
unicorn_pidindicates the path for the pid file. Defaults to"#{shared_path}/tmp/pids/unicorn.pid".unicorn_old_pidindicates the path for the old pid file, which Unicorn creates when forking a new master. Defaults to#{shared_path}/tmp/pids/unicorn.pid.oldbin.unicorn_configthe path to the unicorn config file. Defaults to"#{current_path}/config/unicorn.rb".unicorn_logthe path where unicorn places its STDERR-log. Defaults to"#{shared_path}/log/unicorn.stderr.log".rack_envsets the environment that the server will run in. Defaults to"production".