Report abuse

top of deploy.rb somewhere


			
set :master_repository, "svn+ssh://devmodo.com/data/svn/#{application}/trunk"
set :repository, "#{shared_path}/site_source/trunk"

the meat


			
task :setup_repository, :roles => [:app, :db, :web] do
  # TODO: adding the method here is hacky. Should move to an extension lib
  class Capistrano::SCM::Subversion
    def setup_the_repository(actor, master_repository, repository)
      command = "#{svn} co -q  #{master_repository} #{repository} &&"
      run_checkout(actor, command, &svn_stream_handler(actor)) 
    end
  end
  set :revision, "Initial setup checkout" # avoids capistrano trying to find out for us
  run "mkdir -p #{repository}"
  source.setup_the_repository(self, master_repository, repository)
end

task :update_code, :roles => [:app, :db, :web] do
  # TODO: adding the method here is hacky. Should move to an extension lib
  class Capistrano::SCM::Subversion
    def update_the_repository(actor, repository)
      command = "#{svn} up -q #{repository} &&"
      run_update(actor, command, &svn_stream_handler(actor)) 
    end
  end
  source.update_the_repository(self, repository)

  #on_rollback { delete release_path, :recursive => true }

  run "rsync -ax #{repository}/ #{release_path}/"

  run <<-CMD
    rm -rf #{release_path}/log #{release_path}/public/system &&
    ln -nfs #{shared_path}/log #{release_path}/log &&
    ln -nfs #{shared_path}/system #{release_path}/public/system
  CMD

end