Sha256: 8455d30730ab5cfe5c8bc4dfc5c18ae40cc596f270de599b83b840d331fbe5ca

Contents?: true

Size: 1.38 KB

Versions: 80

Compression:

Stored size: 1.38 KB

Contents

namespace :rubber do

  namespace :apache do
  
    rubber.allow_optional_tasks(self)

    after "rubber:install_packages", "rubber:apache:custom_install"

    task :custom_install, :roles => :apache do
      rsudo "a2dissite default"
    end

    # 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 => :apache do
        rsudo "service apache2 restart"
      end
      rubber.serial_task self, :serial_reload, :roles => :apache do
        rsudo "if ! ps ax | grep -v grep | grep -c apache2 &> /dev/null; then service apache2 start; else service apache2 reload; fi"
      end
    end
    
    before "deploy:stop", "rubber:apache:stop"
    after "deploy:start", "rubber:apache:start"
    after "deploy:restart", "rubber:apache:reload"
    
    desc "Stops the apache web server"
    task :stop, :roles => :apache do
      rsudo "service apache2 stop; exit 0"
    end
    
    desc "Starts the apache web server"
    task :start, :roles => :apache do
      rsudo "service apache2 start"
    end
    
    desc "Restarts the apache web server"
    task :restart, :roles => :apache do
      serial_restart
    end
  
    desc "Reloads the apache web server"
    task :reload, :roles => :apache do
      serial_reload
    end
  
  end

end

Version data entries

80 entries across 40 versions & 6 rubygems

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