Sha256: 2a425a7e680e081543bb324510b55f21d549842a57047d9272048b8337d680f1

Contents?: true

Size: 783 Bytes

Versions: 7

Compression:

Stored size: 783 Bytes

Contents

namespace :nginx do
  desc "Install latest stable release of nginx"
  task :install, roles: :web do
    run "#{sudo} add-apt-repository -y 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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nubis_rails_boilerplate-0.0.11 lib/capistrano_recipes/nginx.rb
nubis_rails_boilerplate-0.0.10 lib/capistrano_recipes/nginx.rb
nubis_rails_boilerplate-0.0.9 lib/capistrano_recipes/nginx.rb
nubis_rails_boilerplate-0.0.8 lib/capistrano_recipes/nginx.rb
nubis_rails_boilerplate-0.0.7 lib/capistrano_recipes/nginx.rb
nubis_rails_boilerplate-0.0.6 lib/capistrano_recipes/nginx.rb
nubis_rails_boilerplate-0.0.5 lib/capistrano_recipes/nginx.rb