Class: Capistrano::SCM::Svn
- Defined in:
- lib/capistrano/scm/svn.rb
Instance Method Summary collapse
- #archive_to_release_path ⇒ Object
- #check_repo_is_reachable ⇒ Object
- #clone_repo ⇒ Object
- #define_tasks ⇒ Object
- #fetch_repo_mirror_url ⇒ Object
- #fetch_revision ⇒ Object
- #register_hooks ⇒ Object
- #repo_mirror_exists? ⇒ Boolean
- #svn(*args) ⇒ Object
- #update_mirror ⇒ Object
Methods inherited from Plugin
Instance Method Details
#archive_to_release_path ⇒ Object
43 44 45 |
# File 'lib/capistrano/scm/svn.rb', line 43 def archive_to_release_path svn :export, "--force", ".", release_path end |
#check_repo_is_reachable ⇒ Object
26 27 28 29 30 |
# File 'lib/capistrano/scm/svn.rb', line 26 def check_repo_is_reachable svn_username = fetch(:svn_username) ? "--username #{fetch(:svn_username)}" : "" svn_password = fetch(:svn_password) ? "--password #{fetch(:svn_password)}" : "" backend.test :svn, :info, repo_url, svn_username, svn_password end |
#clone_repo ⇒ Object
32 33 34 |
# File 'lib/capistrano/scm/svn.rb', line 32 def clone_repo svn :checkout, repo_url, repo_path.to_s end |
#define_tasks ⇒ Object
10 11 12 |
# File 'lib/capistrano/scm/svn.rb', line 10 def define_tasks eval_rakefile File.("../tasks/svn.rake", __FILE__) end |
#fetch_repo_mirror_url ⇒ Object
51 52 53 54 55 |
# File 'lib/capistrano/scm/svn.rb', line 51 def fetch_repo_mirror_url backend.capture(:svn, :info, repo_path.to_s).each_line do |line| return $1 if /\AURL: (.*)\n\z/ =~ line end end |
#fetch_revision ⇒ Object
47 48 49 |
# File 'lib/capistrano/scm/svn.rb', line 47 def fetch_revision backend.capture(:svnversion, repo_path.to_s) end |
#register_hooks ⇒ Object
4 5 6 7 8 |
# File 'lib/capistrano/scm/svn.rb', line 4 def register_hooks after "deploy:new_release_path", "svn:create_release" before "deploy:check", "svn:check" before "deploy:set_current_revision", "svn:set_current_revision" end |
#repo_mirror_exists? ⇒ Boolean
22 23 24 |
# File 'lib/capistrano/scm/svn.rb', line 22 def repo_mirror_exists? backend.test " [ -d #{repo_path}/.svn ] " end |
#svn(*args) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/capistrano/scm/svn.rb', line 14 def svn(*args) args.unshift(:svn) args.push "--username #{fetch(:svn_username)}" if fetch(:svn_username) args.push "--password #{fetch(:svn_password)}" if fetch(:svn_password) args.push "--revision #{fetch(:svn_revision)}" if fetch(:svn_revision) backend.execute(*args) end |