Sha256: 149df7dc3234793c18a79594315b06bd936f56ca20ed73eff2fcaa136ad01331

Contents?: true

Size: 884 Bytes

Versions: 2

Compression:

Stored size: 884 Bytes

Contents

Capistrano::Configuration.instance.load do

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

  namespace :deploy do
    task :start, :roles => :app, :except => { :no_release => true } do
      run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{current_path}/#{unicorn_config} -E #{rails_env} -D"
    end
    task :stop, :roles => :app, :except => { :no_release => true } do
      run "if [ -f #{current_path}/#{unicorn_pid} ]; then #{try_sudo} kill `cat #{current_path}/#{unicorn_pid}`; fi"
    end
    task :graceful_stop, :roles => :app, :except => { :no_release => true } do
      run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`"
    end
    task :restart, :roles => :app, :except => { :no_release => true } do
      stop
      start
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ms_deploy-0.0.11 lib/ms_deploy/recipes/deploy/unicorn.rb
ms_deploy-0.0.10 lib/ms_deploy/recipes/deploy/unicorn.rb