Sha256: 7bd6820c1bc496f7ef792fe3400fb9c185c79013640344b0725412dfeb95f887

Contents?: true

Size: 1.34 KB

Versions: 9

Compression:

Stored size: 1.34 KB

Contents

require 'fileutils'
Capistrano.configuration(:must_exist).load do
 
 desc "Setup svn repository"
 task :setup_svn, :roles => :scm do
   dir = "#{deploy_to}/repos"
   run "mkdir -p #{dir}"
   run "chmod 770 #{dir}"
   run "svnadmin create #{dir}"
 end
 
 desc "Import code into svn repository."
 task :import_svn  do
   new_path = "../#{application}_machine"
   tags = repository.sub("trunk", "tags")
   branches = repository.sub("trunk", "branches")
   puts "Adding branches and tags"
   system "svn mkdir -m 'Adding tags and branches directories' #{tags} #{branches}"
   puts "Importing application."
   system "svn import #{repository} -m 'Import'"
   puts "Checking out to new directory."
   system "svn co #{repository} #{new_path}"
   cwd = Dir.getwd
   Dir.chdir new_path
   puts "removing log directory contents from svn"
   system "svn remove log/*"
   puts "ignoring log directory"
   system "svn propset svn:ignore '*.log' log/"
   system "svn update log/"
   puts "removing tmp directory from svn"
   system "svn remove tmp/"
   puts "ignoring tmp directory"
   system "svn propset svn:ignore '*' tmp/"
   system "svn update tmp/"
   puts "committing changes"
   system "svn commit -m 'Removed and ignored log files and tmp'"
   Dir.chdir cwd
   puts "Your repository is: #{repository}" 
   puts "Please change to your new working directory: #{new_path}"
 end
 
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
deprec-1.1.0 lib/deprec/third_party/railsmachine/recipes/svn.rb
deprec-1.2.0 lib/deprec/third_party/railsmachine/recipes/svn.rb
deprec-1.2.1 lib/deprec/third_party/railsmachine/recipes/svn.rb
deprec-1.2.2 lib/deprec/third_party/railsmachine/recipes/svn.rb
deprec-1.2.3 lib/deprec/third_party/railsmachine/recipes/svn.rb
deprec-1.3.0 lib/deprec/third_party/railsmachine/recipes/svn.rb
deprec-1.3.1 lib/deprec/third_party/railsmachine/recipes/svn.rb
railsmachine-0.1.1 lib/railsmachine/recipes/svn.rb
railsmachine-0.1.0 lib/railsmachine/recipes/svn.rb