kitchen-transport-sshtar 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen-transport-sshtar/version.rb +1 -1
- data/lib/kitchen/transport/sshtar.rb +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840a4d047ba32e134b910ed3f3752125383677d6
|
4
|
+
data.tar.gz: 70892e544bcbaf5dd5c8aaa21b119239285ff6e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4ed346a922eb40219f34dcc940def07b92711fc673bcfb3540ae173b9b1c12901a1433a63e537584181b40befefa048784cf4439c697a8e7a60e737a278b15e
|
7
|
+
data.tar.gz: cc0ab9a2b8e88b0869e06443728e39a15210ee696de6b4aa73ecd8067ec9d2e4c84201282deb68beb85fadb46d2839ec808de89b380a75d945526ee6efde4f18
|
@@ -35,12 +35,20 @@ module Kitchen
|
|
35
35
|
class Connection < Ssh::Connection
|
36
36
|
def upload(locals, remote)
|
37
37
|
Array(locals).each do |local|
|
38
|
-
full_remote = File.join(remote, File.basename(local))
|
39
38
|
recursive = File.directory?(local)
|
40
|
-
|
41
|
-
|
39
|
+
if recursive
|
40
|
+
full_remote = File.join(remote, File.basename(local))
|
42
41
|
tar_command = "tar -C #{local} -c#{@logger.debug? ? 'v' : ''}f - ./"
|
43
42
|
untar_command = "tar #{@logger.debug? ? '' : '--warning=none'} -C #{full_remote} -x#{@logger.debug? ? 'v' : ''}f -"
|
43
|
+
execute("mkdir -p #{full_remote}") if recursive
|
44
|
+
else
|
45
|
+
local_dir = File.dirname(local)
|
46
|
+
local_file = File.basename(local)
|
47
|
+
full_remote = remote
|
48
|
+
tar_command = "tar -C #{local_dir} -c#{@logger.debug? ? 'v' : ''} - #{local_file}"
|
49
|
+
untar_command = "tar #{@logger.debug? ? '' : '--warning=none'} -C #{full_remote} -x#{@logger.debug? ? 'v' : ''}f - #{local_file}"
|
50
|
+
end
|
51
|
+
time = Benchmark.realtime do
|
44
52
|
ssh_command = [login_command.command, login_command.arguments].flatten.join(' ')
|
45
53
|
sync_command = "#{tar_command} | #{ssh_command} '#{untar_command}'"
|
46
54
|
@logger.debug("[SSH-TAR] Running ssh-tar command: #{sync_command}")
|
@@ -53,4 +61,4 @@ module Kitchen
|
|
53
61
|
|
54
62
|
end
|
55
63
|
end
|
56
|
-
end
|
64
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-transport-sshtar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilja Bobkevic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|