Sha256: 2831fbefbf871bea4cb2d4a9a6a1dd29d0cd7edd4f3a2c664556b5b859a50adc

Contents?: true

Size: 1.73 KB

Versions: 16

Compression:

Stored size: 1.73 KB

Contents

namespace :rubber do

  namespace :passenger do
  
    rubber.allow_optional_tasks(self)
  
    after "rubber:install_gems", "rubber:passenger:custom_install"
    
    task :custom_install, :roles => :passenger do
      rubber.sudo_script 'install_passenger', <<-ENDSCRIPT
        # can't use passenger_lib from rubber here as it only evaluates correctly
        # when variable interpolation of rvm_gem_home is run remotely, and since we
        # are in cap, we run the interpolation locally
        #
        passenger_lib=$(find /usr/local/rvm -path "*/passenger-#{rubber_env.passenger_version}/*/mod_passenger.so" 2> /dev/null)
        if [[ -z $passenger_lib ]]; then
          echo -en "\n\n\n\n" | passenger-install-apache2-module
          rvm #{rubber_env.rvm_ruby} --passenger
        fi
      ENDSCRIPT
    end

    after "rubber:setup_app_permissions", "rubber:passenger:setup_passenger_permissions"

    task :setup_passenger_permissions, :roles => :passenger do
      rsudo "chown #{rubber_env.app_user}:#{rubber_env.app_user} #{current_path}/config/environment.rb"
    end

    # passenger does things differently for rack apps, so if this is a rails app, remove config.ru
    # to stop passenger from treating this like a rack app
    after "deploy:update_code", "rubber:passenger:remove_config_ru" if Rubber::Util.is_rails?

    task :remove_config_ru, :roles => :passenger do
      rsudo "rm -f  #{current_release}/config.ru"
    end

    # passenger depends on apache for start/stop/restart, just need these defined
    # as apache hooks into standard deploy lifecycle
    
    deploy.task :restart, :roles => :app do
    end
    
    deploy.task :stop, :roles => :app do
    end
    
    deploy.task :start, :roles => :app do
    end
    
  end
end

Version data entries

16 entries across 8 versions & 1 rubygems

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