Sha256: 89c1e783d1cde076131ec692a902a3062ee34bd5edb3414d83c0c3b6efe38830

Contents?: true

Size: 908 Bytes

Versions: 33

Compression:

Stored size: 908 Bytes

Contents

if Capistrano::Configuration.instance(false)

  Capistrano::Configuration.instance(true).load do |instance|

    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}"
      end
      # after "deploy:setup", "nginx:setup"
      
      %w[start stop restart].each do |command|
        desc "#{command} unicorn"
        task command, roles: :web do
          run "/etc/init.d/#{application} #{command}"
        end
      end
    end

  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
pixelforce_recipes-3.9.2 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.9.1 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.9 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.8 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.7 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.6 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.5 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.4 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.3 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.2 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.1 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-3.0 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-2.4 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-2.3 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-2.1 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-2.0 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-1.8 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-1.6 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-1.5 lib/pixelforce_recipes/legacy_recipes/unicorn.rb
pixelforce_recipes-1.4 lib/pixelforce_recipes/legacy_recipes/unicorn.rb