Sha256: 7e304d23c143a8ca790e16fca5582fa772f1967a18889256f31ed263ed2b5337

Contents?: true

Size: 1.41 KB

Versions: 29

Compression:

Stored size: 1.41 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
      sudo "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
        run "/etc/init.d/apache2 restart"
      end
      rubber.serial_task self, :serial_reload, :roles => :apache do
        run "if ! ps ax | grep -v grep | grep -c apache2 &> /dev/null; then /etc/init.d/apache2 start; else /etc/init.d/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, :on_error => :continue do
      run "/etc/init.d/apache2 stop"
    end
    
    desc "Starts the apache web server"
    task :start, :roles => :apache do
      run "/etc/init.d/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

29 entries across 29 versions & 5 rubygems

Version Path
sml-rubber-0.9.10 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
sml-rubber-0.9.11 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
sml-rubber-0.9.13 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
wr0ngway-rubber-1.0.0 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
wr0ngway-rubber-1.0.1 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
axtro-rubber-1.2.3 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
axtro-rubber-1.2.2 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.2.1 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
axtro-rubber-1.2.1 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
axtro-rubber-1.2.0 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
axtro-rubber-1.0.2.8 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
axtro-rubber-1.0.2.7 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.2.0 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
nirvdrum-rubber-1.1.7 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.1.7 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.1.6 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.1.5 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.1.4 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.1.3 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb
rubber-1.1.2 generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb