Object
# File lib/blimpy/livery/base.rb, line 32 def can_rsync?(box) @can_rsync ||= box.ssh_into('-q', 'which rsync > /dev/null') end
# File lib/blimpy/livery/base.rb, line 55 def dir_name File.basename(livery_root) end
# File lib/blimpy/livery/base.rb, line 8 def flight(*args) raise NotImplementedError end
# File lib/blimpy/livery/base.rb, line 51 def livery_root Dir.pwd end
# File lib/blimpy/livery/base.rb, line 12 def postflight(*args) end
# File lib/blimpy/livery/base.rb, line 5 def preflight(*args) end
# File lib/blimpy/livery/base.rb, line 19 def rsync_command excludes = rsync_excludes.map { |x| "--exclude=#{x}" } if File.exists? '.blimpignore' excludes << '--exclude-from=.blimpignore' end ['rsync', '-avL', '-e', 'ssh -o StrictHostKeyChecking=no'] + excludes end
# File lib/blimpy/livery/base.rb, line 15 def rsync_excludes ['.git', '.svn', '.blimpy.d'] end
# File lib/blimpy/livery/base.rb, line 59 def setup_on(box) sync_to(box) end
# File lib/blimpy/livery/base.rb, line 36 def sync_to(box) if can_rsync? box command = rsync_command + ['.', "#{box.username}@#{box.dns}:#{dir_name}/"] box.run_command(*command) else puts "Remote host has no rsync(1), falling back to copying a full tarball over" tarball = Blimpy::Livery.tarball_directory(livery_root) box.scp_file(tarball) # HAXX basename = File.basename(tarball) box.ssh_into("tar -zxf #{basename} && cd #{dir_name}") end end
Generated with the Darkfish Rdoc Generator 2.