Sha256: 83c0efda44b3801532385d5e166d0e0060d18108020c9972dabd2699a2b93e69

Contents?: true

Size: 768 Bytes

Versions: 1

Compression:

Stored size: 768 Bytes

Contents

namespace :unicorn do
  desc "Install unicorn"

  desc "Setup unicorn configuration for this application"
  task :setup, roles: :web do
    template "unicorn_init.erb", "/tmp/unicorn"
    run "#{sudo} mv /tmp/unicorn /etc/init.d/#{application}"
    run "#{sudo} chmod +x /etc/init.d/#{application}"
    run "#{sudo} update-rc.d #{application} defaults"
    template "nginx_config.erb", "/tmp/nginx_config"
    run "#{sudo} mv /tmp/nginx_config /etc/nginx/sites-enabled/#{application}"
    run "#{sudo} rm -f /etc/nginx/sites-enabled/default"
  end
  # after "deploy:setup", "nginx:setup"
  
  %w[start stop restart].each do |command|
    desc "#{command} unicorn"
    task command, roles: :web do
      run "#{sudo} service #{application} #{command}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pixelforce_cms-0.9.1 lib/generators/pixelforce_cms/templates/recipes/unicorn.rb