Sha256: 328285aabc6d3ea24aa3965f253542384fccc9c65d11abee19b405287fc60465
Contents?: true
Size: 1.1 KB
Versions: 2
Compression:
Stored size: 1.1 KB
Contents
set_default(:project_domain) { Capistrano::CLI.ui.ask 'Project Domain=> ' } namespace :nginx do desc 'Install nginx' task :install do run "#{sudo} add-apt-repository -y ppa:nginx/stable" run "#{sudo} apt-get -y update" run "#{sudo} apt-get -y install nginx" run "#{sudo} service nginx start" end after 'deploy:install', 'nginx:install' desc 'Nginx setup.' task :setup do puts "Creating #{shared_path}/config/nginx.#{rails_env}.conf" template "nginx.#{rails_env}.erb", "#{shared_path}/config/nginx.#{rails_env}.conf" puts "Symlinks #{shared_path}/config/nginx.#{rails_env}.conf to /etc/nginx/sites-enabled/#{application}" sudo "ln -nfs #{shared_path}/config/nginx.#{rails_env}.conf /etc/nginx/sites-enabled/#{application}" puts 'Removing /etc/nginx/sites-enabled/default' sudo 'rm -f /etc/nginx/sites-enabled/default' end %w[start stop restart reload].each do |command| desc "Nginx #{command}" task command, role: :web do sudo "service nginx #{command}" end end after 'deploy:setup', 'nginx:setup' after 'deploy:setup', 'nginx:reload' end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
recipes_matic-1.1.0 | lib/generators/recipes_matic/templates/config/deploy/recipes/nginx.rb |
recipes_matic-1.0.0 | lib/generators/recipes_matic/templates/config/deploy/recipes/nginx.rb |