Sha256: 263eda9bd0a1afd5c239242b1edd41a070d3ad982bd80cb0a2e29b76fd5fd8fe

Contents?: true

Size: 1.59 KB

Versions: 53

Compression:

Stored size: 1.59 KB

Contents

Capistrano::Configuration.instance.load do
  namespace :burp do

    desc 'Creates the CMS dir in the shared directory'
    task :setup do
      run "mkdir -p #{shared_path}/cms"
      run "git init #{shared_path}/cms"
    end
    after 'deploy:setup', 'burp:setup'

    desc 'Links the shared CMS dir'  
    task :link_cms_dir do
      run "rmdir #{latest_release}/app/cms; ln -s #{shared_path}/cms #{latest_release}/app/cms"
    end
    after 'deploy:update', 'burp:link_cms_dir'

    desc "Merges the live CMS with the local"
    task :pull, :roles => :web, :once => true do
  
      server = roles[:web].servers.first.host
      user = ssh_options[:user]+"@" || ""
  
      `cd app/cms; git pull #{user}#{server}:#{shared_path}/cms/ master`
    end

    desc "Push local changes to live"
    task :push, :roles => :web, :once => true do
      
      server = roles[:web].servers.first.host
      user = ssh_options[:user]+"@" || ""
      
      `cd app/cms; git push #{user}#{server}:#{shared_path}/cms/ master:local_master`
      
      transaction do
        on_rollback do
          run "cd #{shared_path}/cms; git checkout -f"
          puts "\n\e[0;31m   ######################################################################"
          puts "   #\n   #                  Auto merge faild."
          puts "   #\n   #       Do \"cap burp:pull\" resolve the merge and the try again."
          puts "   #\n"
          puts "   ######################################################################\e[0m\n"
        end
  
        run "cd #{shared_path}/cms; git merge local_master"
      end
      
    end
  end
end
    

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
burp_cms-1.7.1 lib/burp/capistrano.rb
burp_cms-1.7.0 lib/burp/capistrano.rb
burp_cms-1.6.0 lib/burp/capistrano.rb
burp_cms-1.5.13 lib/burp/capistrano.rb
burp_cms-1.5.12 lib/burp/capistrano.rb
burp_cms-1.5.11 lib/burp/capistrano.rb
burp_cms-1.5.10 lib/burp/capistrano.rb
burp_cms-1.5.9 lib/burp/capistrano.rb
burp_cms-1.5.8 lib/burp/capistrano.rb
burp_cms-1.5.7 lib/burp/capistrano.rb
burp_cms-1.5.6 lib/burp/capistrano.rb
burp_cms-1.5.5 lib/burp/capistrano.rb
burp_cms-1.5.4 lib/burp/capistrano.rb
burp_cms-1.5.3 lib/burp/capistrano.rb
burp_cms-1.5.2 lib/burp/capistrano.rb
burp_cms-1.5.1 lib/burp/capistrano.rb
burp_cms-1.5.0 lib/burp/capistrano.rb
burp_cms-1.4.1 lib/burp/capistrano.rb
burp_cms-1.4.0 lib/burp/capistrano.rb
burp_cms-1.3.33 lib/burp/capistrano.rb