Class: Capistrano::SCM::Svn
Instance Method Summary
collapse
Methods inherited from Plugin
#scm?
Methods inherited from Plugin
#set_defaults
Methods included from DSL
#execute, #invoke, #invoke!, #local_user, #lock, #on, #revision_log_message, #rollback_log_message, #run_locally, #scm, #sudo, #t
#stage_definitions, #stage_set?, #stages
Methods included from DSL::Paths
#asset_timestamp, #current_path, #deploy_config_path, #deploy_path, #deploy_to, #join_paths, #linked_dir_parents, #linked_dirs, #linked_file_dirs, #linked_files, #map_dirnames, #now, #release_path, #releases_path, #repo_path, #repo_url, #revision_log, #set_release_path, #shared_path, #stage_config_path
Methods included from DSL::Env
#asset_timestamp, #env, #release_roles, #release_timestamp, #role_properties, #roles
#after, #before, #default_tasks, #define_remote_file_task, #deploying?, #ensure_stage, #exit_deploy_because_of_exception, #tasks_without_stage_dependency
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.expand_path("../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
|
#update_mirror ⇒ Object
36
37
38
39
40
41
|
# File 'lib/capistrano/scm/svn.rb', line 36
def update_mirror
repo_mirror_url = fetch_repo_mirror_url
svn :switch, repo_url unless repo_mirror_url == repo_url
svn :update
end
|