Sha256: 52a6ac8132c7c3428306ff795e0c27b6f168e451f5de0bb411497659977d1aae

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

namespace :rubber do

  namespace :resque do
  
    rubber.allow_optional_tasks(self)
  
    after "rubber:install_packages", "rubber:resque:custom_install"
    
    task :custom_install, :roles => :resque do
      rubber.sudo_script 'install_resque', <<-ENDSCRIPT
        if [ -d resque ]; then
          rm -r resque
        fi

        git clone git://github.com/defunkt/resque.git

        if [ -d #{rubber_env.resque_web_dir} ]; then
          rm -r #{rubber_env.resque_web_dir}
        fi

        mkdir -p #{rubber_env.resque_web_dir}
        mkdir #{rubber_env.resque_web_dir}/tmp
        mv resque/config.ru #{rubber_env.resque_web_dir}
        mv resque/lib/resque/server/* #{rubber_env.resque_web_dir}/

        rm -f /var/www/resque
        ln -s #{rubber_env.resque_web_dir}/public /var/www/resque
      ENDSCRIPT
    end

    after "rubber:setup_app_permissions", "rubber:resque:setup_resque_permissions"

    task :setup_resque_permissions, :roles => :resque do
      sudo "chown -R #{rubber_env.app_user}:#{rubber_env.app_user} #{rubber_env.resque_web_dir}/config.ru"
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubber-1.3.2 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.3.1 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.3.0 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb