class Capistrano::BundleRsync::LocalGit
Public Instance Methods
check()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 5 def check raise ArgumentError.new('`repo_url` must be local path to use `local_git` scm') unless local_path?(repo_url) exit 1 unless execute("git ls-remote #{repo_url} HEAD") execute("mkdir -p #{config.local_base_path}") end
clean_release()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 20 def clean_release end
clone()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 11 def clone end
create_release()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 17 def create_release end
rsync_release()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 23 def rsync_release hosts = ::Capistrano::Configuration.env.filter(release_roles(:all)) rsync_options = config.rsync_options Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host| ssh = config.build_ssh_command(host) if tree = fetch(:repo_tree) execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{repo_url}/#{tree}/ #{host}:#{release_path}/" else execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{repo_url}/ #{host}:#{release_path}/" end end end
set_current_revision()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 36 def set_current_revision within repo_url do set :current_revision, capture(:git, "rev-parse --short HEAD") end end
update()
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 14 def update end
Private Instance Methods
local_path?(repo_url)
click to toggle source
# File lib/capistrano/bundle_rsync/local_git.rb, line 44 def local_path?(repo_url) return !( repo_url.start_with?('http://') or repo_url.start_with?('https://') or repo_url.start_with?('git://') or repo_url.start_with?('git@') or repo_url.start_with?('ssh://') ) end