Sha256: fad5c9718497c1200b3b0549fd2d6972bd9dafe641aaeaa405549f133e25383e

Contents?: true

Size: 972 Bytes

Versions: 8

Compression:

Stored size: 972 Bytes

Contents

set_default(:unicorn_user) { user }
set_default(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" }
set_default(:unicorn_config) { "#{shared_path}/config/unicorn.rb" }
set_default(:unicorn_log) { "#{shared_path}/log/unicorn.log" }
set_default(:unicorn_workers, 2)

namespace :unicorn do
  desc "Setup Unicorn initializer and app configuration"
  task :setup, roles: :app do
    run "mkdir -p #{shared_path}/config"
    template "unicorn.rb.erb", unicorn_config
    template "unicorn_init.erb", "/tmp/unicorn_init"
    run "chmod +x /tmp/unicorn_init"
    run "#{sudo} mv /tmp/unicorn_init /etc/init.d/unicorn_#{application}"
    run "#{sudo} update-rc.d -f unicorn_#{application} defaults"
  end
  after "deploy:setup", "unicorn:setup"

  %w[start stop restart].each do |command|
    desc "#{command} unicorn"
    task command, roles: :app do
      run "service unicorn_#{application} #{command}"
    end
    after "deploy:#{command}", "unicorn:#{command}"
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
nubis_rails_boilerplate-0.0.11 lib/capistrano_recipes/unicorn.rb
nubis_rails_boilerplate-0.0.10 lib/capistrano_recipes/unicorn.rb
nubis_rails_boilerplate-0.0.9 lib/capistrano_recipes/unicorn.rb
nubis_rails_boilerplate-0.0.8 lib/capistrano_recipes/unicorn.rb
nubis_rails_boilerplate-0.0.7 lib/capistrano_recipes/unicorn.rb
nubis_rails_boilerplate-0.0.6 lib/capistrano_recipes/unicorn.rb
nubis_rails_boilerplate-0.0.5 lib/capistrano_recipes/unicorn.rb
cap_recipes-0.0.3 config/recipes/unicorn.rb