Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/kitchen/transport/rsync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def create_new_connection(options, &block)
@connection.close
end

$kitchen_rsync_opts = self.[](:rsync_options) if self.[](:rsync_options)

@connection_options = options
@connection = self.class::Connection.new(options, &block)
end
Expand All @@ -50,7 +52,12 @@ def upload(locals, remote)
rsync_candidates = locals.select {|path| File.directory?(path) && File.basename(path) != 'cache' }
ssh_command = "ssh #{ssh_args.join(' ')}"
copy_identity
rsync_cmd = "/usr/bin/rsync -e '#{ssh_command}' -az#{logger.level == :debug ? 'vv' : ''} --delete #{rsync_candidates.join(' ')} #{@session.options[:user]}@#{@session.host}:#{remote}"
rsync_cmd = "/usr/bin/rsync -e '#{ssh_command}' -az#{logger.level == :debug ? 'vv' : ''} --delete "
if $kitchen_rsync_opts && $kitchen_rsync_opts[:excludes]
rsync_cmd << $kitchen_rsync_opts[:excludes].map { |e| "--exclude '#{e}'" }.join(' ')
rsync_cmd << ' '
end
rsync_cmd << "#{rsync_candidates.join(' ')} #{@session.options[:user]}@#{@session.host}:#{remote}"
logger.debug("[rsync] Running rsync command: #{rsync_cmd}")
ret = []
time = Benchmark.realtime do
Expand Down