Module: LeapCli::Remote::RsyncPlugin
- Defined in:
- lib/leap_cli/remote/rsync_plugin.rb
Instance Method Summary collapse
-
#update ⇒ Object
takes a block, yielded a server, that should return a hash with various rsync options.
Instance Method Details
#update ⇒ Object
takes a block, yielded a server, that should return a hash with various rsync options. supported options include:
{:source => '', :dest => '', :flags => '', :includes => [], :excludes => []}
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/leap_cli/remote/rsync_plugin.rb', line 16 def update rsync = RsyncCommand.new(:logger => logger) rsync.asynchronously(find_servers) do |server| = yield server next unless remote_user = server.user || fetch(:user, ENV['USER']) src = [:source] dest = {:user => remote_user, :host => server.host, :path => [:dest]} [:ssh] = .merge(server.[:ssh_options]||{}) [:chdir] ||= Path.provider rsync.exec(src, dest, ) end if rsync.failed? LeapCli::Util.bail! do LeapCli::Util.log :failed, "to rsync to #{rsync.failures.map{|f|f[:dest][:host]}.join(' ')}" end end end |