namespace :siesqo 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.siesqocoders.be/redirect/index.phps" execute :wget, '-qO', "#{shared_path}/redirect/.htaccess http://static.siesqocoders.be/redirect/htaccess" execute :sed, '-i', "'s||#{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