Sha256: 4f363524c118f7a534866eedf20cc53317b09e2748dd1ca17eea5f8ed770d728

Contents?: true

Size: 1.46 KB

Versions: 17

Compression:

Stored size: 1.46 KB

Contents

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

  namespace :nginx do 
    desc "Start Nginx on the app slices."
    task :start, :roles => :app, :except => {:nginx => false} do
      sudo "nohup /etc/init.d/nginx start 2>&1 | cat"
    end

    desc "Restart the Nginx processes on the app slices."
    task :restart , :roles => :app, :except => {:nginx => false} do
      sudo "nohup /etc/init.d/nginx restart 2>&1 | cat"
    end

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

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

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

    desc "Tail the nginx error logs on the app slices"
    task :tail_error, :roles => :app, :except => {:nginx => false} 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

17 entries across 17 versions & 1 rubygems

Version Path
eycap-0.6.12 lib/eycap/recipes/nginx.rb
eycap-0.6.11 lib/eycap/recipes/nginx.rb
eycap-0.6.10 lib/eycap/recipes/nginx.rb
eycap-0.6.9 lib/eycap/recipes/nginx.rb
eycap-0.6.8 lib/eycap/recipes/nginx.rb
eycap-0.6.7 lib/eycap/recipes/nginx.rb
eycap-0.6.6 lib/eycap/recipes/nginx.rb
eycap-0.6.5 lib/eycap/recipes/nginx.rb
eycap-0.6.4 lib/eycap/recipes/nginx.rb
eycap-0.6.3 lib/eycap/recipes/nginx.rb
eycap-0.6.2 lib/eycap/recipes/nginx.rb
eycap-0.6.1 lib/eycap/recipes/nginx.rb
eycap-0.6.0 lib/eycap/recipes/nginx.rb
eycap-0.5.23 lib/eycap/recipes/nginx.rb
eycap-0.5.22 lib/eycap/recipes/nginx.rb
eycap-0.5.21 lib/eycap/recipes/nginx.rb
eycap-0.5.20 lib/eycap/recipes/nginx.rb