Sha256: 43c4a18396654ab1b06bb69d00d98ea56a9e5e5a89231fe93786369b932b1e9c

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

Capistrano::Configuration.instance.load do

  set :unicorn_bin, "bundle exec unicorn"
  set :unicorn_config, "config/unicorn.#{fetch(:stage, 'production')}.rb"
  set :unicorn_pid, "tmp/pids/unicorn.pid"

  #require "capistrano-unicorn"

  namespace :deploy do
    desc 'Start unicorn'
    task :start, :roles => :app, :except => {:no_release => true} do
      run "cd #{current_path} && #{try_sudo} #{unicorn_bin} -c #{current_path}/#{unicorn_config} -E #{rails_env} -D"
    end

    desc 'Stop unicorn'
    task :stop, :roles => :app, :except => {:no_release => true} do
      run "if [ -f #{current_path}/#{unicorn_pid} ]; then #{try_sudo} kill -QUIT `cat #{current_path}/#{unicorn_pid}`; fi"
    end

    desc 'Restart unicorn'
    task :restart, :roles => :app, :except => {:no_release => true} do
      run "cd #{current_path} && #{try_sudo} kill -HUP `cat #{current_path}/#{unicorn_pid}`"
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ms_deploy-0.1.1 lib/ms_deploy/recipes/unicorn.rb