Sha256: 0e64c5d8d3d9c55f0bc710e8b5cca35184b4da3e334c06cba893b8153111d55b

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

# Require our base drupal library
require 'ash/drupal'

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do

  # shared servers typically don't allow `sudo`,
  # so this will tell `try_sudo` to run as the `:user` instead
  set :use_sudo, false

  # --------------------------------------------
  # Overloaded Methods
  # --------------------------------------------
  namespace :deploy do
    desc "Setup shared application directories and permissions after initial setup"
    task :setup_shared do
      # remove Capistrano specific directories
      run "rm -Rf #{shared_path}/log"
      run "rm -Rf #{shared_path}/pids"
      run "rm -Rf #{shared_path}/system"

      # create shared directories
      multisites.each_pair do |folder, url|
        run "mkdir -p #{shared_path}/#{url}/files"
      end

      # set correct permissions for a shared hosting environment
      run "chmod -R 755 #{shared_path}/*"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-ash-1.4.1 lib/ash/drupal_shared_hosting.rb
capistrano-ash-1.4.0 lib/ash/drupal_shared_hosting.rb
capistrano-ash-1.3.7 lib/ash/drupal_shared_hosting.rb