No commit activity in last 3 years
No release in over 3 years
Contains a collection of simple tasks to manage Unicorn with Capistrano.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0

Runtime

 Project Readme

Simple Capistrano Unicorn

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.

Setup

1. Add Gem to Gemfile

gem 'simple-capistrano-unicorn'

2. Require this gem

You should add this line to your Capfile:

require 'capistrano/simple-capistrano-unicorn'

3. Restart Unicorn on deploy

You should place this line in PROJECT_ROOT/config/deploy.rb:

after 'deploy', 'unicorn:restart'

4. Add your unicorn.rb

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.

Usage

Go through the setup and run: cap production deploy

The gem gives you access to the following tasks:

  • unicorn:start starts the Unicorn processes
  • unicorn:stop stops the Unicorn processes
  • unicorn:restart makes a seamless zero-downtime restart
  • unicorn:hard_restart basically runs unicorn:stop followed with a unicorn:start

Requirements

  • unicorn
  • capistrano

Customization

You can customize the gems behavior by setting any (or all) of the following options within capistrano's configuration:

  • unicorn_pid indicates the path for the pid file. Defaults to "#{shared_path}/tmp/pids/unicorn.pid".
  • unicorn_old_pid indicates 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_config the path to the unicorn config file. Defaults to "#{current_path}/config/unicorn.rb".
  • unicorn_log the path where unicorn places its STDERR-log. Defaults to "#{shared_path}/log/unicorn.stderr.log".
  • rack_env sets the environment that the server will run in. Defaults to "production".