Sha256: 561182a120a9c179e3691bf99a92623ae38c1494c3cdd7a92ab27eb081a18d9e

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

Capistrano::Configuration.instance(:must_exist).load do

  namespace :nginx do 
    desc "Start Nginx on the app slices."
    task :start, :roles => :app do
      sudo "nohup /etc/init.d/nginx start > /dev/null"
    end

    desc "Restart the Nginx processes on the app slices."
    task :restart , :roles => :app do
      sudo "nohup /etc/init.d/nginx restart > /dev/null"
    end

    desc "Stop the Nginx processes on the app slices."
    task :stop , :roles => :app do
      sudo "/etc/init.d/nginx stop"
    end
    
    desc "Reload the Nginx config on the app slices."
    task :reload , :roles => :app do
      sudo "/etc/init.d/nginx reload"
    end

    desc "Upgrade the Nginx processes on the app slices."
    task :upgrade , :roles => :app do
      sudo "/etc/init.d/nginx upgrade"
    end

    desc "Test the Nginx config on the app slices."
    task :configtest , :roles => :app do
      sudo "/etc/init.d/nginx configtest"
    end

    desc "Tail the nginx access logs for this application"
    task :tail, :roles => :app do
      run "tail -f /var/log/engineyard/nginx/#{application}.access.log" do |channel, stream, data|
        puts "#{channel[:server]}: #{data}" unless data =~ /^10\.[01]\.0/ # skips lb pull pages
        break if stream == :err    
      end
    end

    desc "Tail the nginx error logs on the app slices"
    task :tail_error, :roles => :app do
      run "tail -f /var/log/engineyard/nginx/error.log" do |channel, stream, data|
        puts "#{channel[:server]}: #{data}" unless data =~ /^10\.[01]\.0/ # skips lb pull pages
        break if stream == :err    
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
engineyard-eycap-0.4.10 lib/eycap/recipes/nginx.rb