Sha256: e633425a350e05b8b2f534adc7f0a3ff9e6991e582b811331117e3dfdd8ac7ed

Contents?: true

Size: 1.72 KB

Versions: 7

Compression:

Stored size: 1.72 KB

Contents

# Number of workers (Rule of thumb is 2 per CPU)
# Just be aware that every worker needs to cache all classes and thus eat some
# of your RAM.
set_default :unicorn_workers, 1

# Workers timeout in the amount of seconds below, when the master kills it and
# forks another one.
set_default  :unicorn_workers_timeout, 30

# Workers are started with this user
# By default we get the user/group set in capistrano.
set_default  :unicorn_user, user

# The wrapped bin to start unicorn
set_default  :unicorn_bin, 'bin/unicorn'
set_default  :unicorn_socket, fetch(:app_server_socket)

# Defines where the unicorn pid will live.
set_default  :unicorn_pid, File.join(current_path, "tmp", "pids", "unicorn.pid")

# Preload app for fast worker spawn
set_default :unicorn_preload, true

# Unicorn
#------------------------------------------------------------------------------
namespace :unicorn do
  desc "Starts unicorn directly"
  task :start, :roles => :app do
    run "cd #{current_path} && #{unicorn_bin} -c #{shared_path}/config/unicorn.rb -E #{rails_env} -D"
  end

  desc "Stops unicorn directly"
  task :stop, :roles => :app do
    run "kill -QUIT `cat #{unicorn_pid}`"
  end

  desc "Restarts unicorn directly"
  task :restart, :roles => :app do
    run "kill -USR2 `cat #{unicorn_pid}`"
  end

  after "deploy:setup", "unicorn:setup"
  desc "Setup unicorn configuration for this application."
   task :setup, roles: :app do
    template "unicorn.erb", "/tmp/unicorn.rb"
    run "#{sudo} mv /tmp/unicorn.rb #{shared_path}/config/"
  end

  after "deploy", "unicorn:restart"
  after "deploy:cold", "unicorn:start"
end


# after 'deploy:setup' do
#   unicorn.setup if Capistrano::CLI.ui.agree("Create unicorn configuration file? [Yn]")
# end if is_using_unicorn

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
negroku-0.0.9 lib/negroku/tasks/unicorn.rb
negroku-0.0.8 lib/negroku/tasks/unicorn.rb
negroku-0.0.7 lib/negroku/tasks/unicorn.rb
negroku-0.0.6 lib/negroku/tasks/unicorn.rb
negroku-0.0.5 lib/negroku/tasks/unicorn.rb
negroku-0.0.4 lib/negroku/tasks/unicorn.rb
negroku-0.0.3 lib/negroku/tasks/unicorn.rb