Sha256: fbe069be3363b7371925b92b87896f703fa9e400de4ebf75e2abd0822c9cd13e

Contents?: true

Size: 1.21 KB

Versions: 81

Compression:

Stored size: 1.21 KB

Contents

namespace :rubber do

  namespace :nginx do
  
    rubber.allow_optional_tasks(self)
    
    # serial_task can only be called after roles defined - not normally a problem, but
    # rubber auto-roles don't get defined till after all tasks are defined
    on :load do
      rubber.serial_task self, :serial_restart, :roles => :nginx do
        rsudo "service nginx restart"
      end
      rubber.serial_task self, :serial_reload, :roles => :nginx do
        rsudo "if ! ps ax | grep -v grep | grep -c nginx &> /dev/null; then service nginx start; else service nginx reload; fi"
      end
    end
    
    before "deploy:stop", "rubber:nginx:stop"
    after "deploy:start", "rubber:nginx:start"
    after "deploy:restart", "rubber:nginx:reload"
    
    desc "Stops the nginx web server"
    task :stop, :roles => :nginx do
      rsudo "service nginx stop; exit 0"
    end
    
    desc "Starts the nginx web server"
    task :start, :roles => :nginx do
      rsudo "service nginx start"
    end
    
    desc "Restarts the nginx web server"
    task :restart, :roles => :nginx do
      serial_restart
    end
  
    desc "Reloads the nginx web server"
    task :reload, :roles => :nginx do
      serial_reload
    end
  
  end

end

Version data entries

81 entries across 41 versions & 6 rubygems

Version Path
rubber-2.0.0.pre1 templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.15.0 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.15.0 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.14.1 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.14.1 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.14.0 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.14.0 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.13.2 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.13.2 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.13.1 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.13.1 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.13.0 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.13.0 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.12.2 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.12.2 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.12.1 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.12.1 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.12.0 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.12.0 generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb
rubber-1.11.0 lib/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb