Sha256: a463de6ee7c7af81e8c3a552b7bc64b6f4399afeaa63cf431ca5118192217d84

Contents?: true

Size: 886 Bytes

Versions: 3

Compression:

Stored size: 886 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do
  namespace :nginx do
    desc "Install latest stable release of nginx"
    task :install, roles: :web do
      run "#{sudo} add-apt-repository ppa:nginx/stable"
      run "#{sudo} apt-get -y update"
      run "#{sudo} apt-get -y install nginx"
    end
    after "deploy:install", "nginx:install"

    desc "Setup nginx configuration for this application"
    task :setup, roles: :web do
      template "nginx_unicorn.erb", "/tmp/nginx_conf"
      run "#{sudo} mv /tmp/nginx_conf /etc/nginx/sites-enabled/#{application}"
      run "#{sudo} rm -f /etc/nginx/sites-enabled/default"
      restart
    end
    after "deploy:setup", "nginx:setup"
  
    %w[start stop restart].each do |command|
      desc "#{command} nginx"
      task command, roles: :web do
        run "#{sudo} service nginx #{command}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cap_bootstrap-0.3.0 lib/cap_bootstrap/recipes/nginx.rb
cap_bootstrap-0.2 lib/cap_bootstrap/recipes/nginx.rb
cap_bootstrap-0.1 lib/cap_bootstrap/recipes/nginx.rb