Sha256: ea5c818825237cad021363dd3657203886040fd300f22de1aae9fbf1b63f2587

Contents?: true

Size: 723 Bytes

Versions: 3

Compression:

Stored size: 723 Bytes

Contents

namespace :sumo do
  namespace :redirect do
    desc 'Enable a redirect page, all traffic will be redirected to this page.'
    task :enable do
      on roles(:web) do
        execute :mkdir, '-p', "#{shared_path}/redirect"
        execute :wget, '-qO', "#{shared_path}/redirect/index.php http://static.sumocoders.be/redirect2/index.phps"
        execute :wget, '-qO', "#{shared_path}/redirect/.htaccess http://static.sumocoders.be/redirect2/htaccess"
        execute :sed, '-i', "'s|<real-url>|#{fetch :production_url}|' #{shared_path}/redirect/index.php"
        execute :rm, '-f', "#{fetch :deploy_to}/current"
        execute :ln, '-s', "#{shared_path}/redirect #{fetch :deploy_to}/current"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-sumo-1.4.2 lib/capistrano/tasks/redirect.rake
capistrano-sumo-1.4.1 lib/capistrano/tasks/redirect.rake
capistrano-sumo-1.4.0 lib/capistrano/tasks/redirect.rake