Module: CapistranoDeploy::Unicorn

Defined in:
lib/capistrano-deploy/unicorn.rb

Class Method Summary collapse

Class Method Details

.load_into(configuration) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/capistrano-deploy/unicorn.rb', line 3

def self.load_into(configuration)
  configuration.load do
    set(:unicorn_pid) { "`cat #{deploy_to}/tmp/pids/unicorn.pid`" }

    namespace :unicorn do
      desc 'Reload unicorn'
      task :reload, :roles => :app, :except => {:no_release => true} do
        run "kill -HUP #{unicorn_pid}"
      end

      desc 'Stop unicorn'
      task :stop, :roles => :app, :except => {:no_release => true} do
        run "kill -QUIT #{unicorn_pid}"
      end

      desc 'Reexecute unicorn'
      task :reexec, :roles => :app, :except => {:no_release => true} do
        run "kill -USR2 #{unicorn_pid}"
      end
    end
  end
end