kitchen-dokken 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/dokken.rb +1 -1
- data/lib/kitchen/driver/dokken_version.rb +1 -1
- data/lib/kitchen/transport/dokken.rb +53 -53
- 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: 81daf71f8d536cfea2ed2c3cc01515f1314c6e5b
|
|
4
|
+
data.tar.gz: 2b534fd81353056a9dcc0b979f4851f34da2c361
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66e0a6d48b6c8491b46c4b16fb12cb2ebc885ce70357b62bf0cbd14c451b066fee8c8c358168e830d6e95518710f8679ec65537ffc56a1fa767fd2117373eee0
|
|
7
|
+
data.tar.gz: 68fc9c3c03950a75a5169cd779ac9669da7d1801d28cbf698df09c3d12e1dda325b8c72c2c3d22e26ce972a0007914290a765c971ed7f28909fab6e96f49ab5e
|
|
@@ -64,7 +64,7 @@ module Kitchen
|
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def execute(command)
|
|
67
|
-
return if command.nil?
|
|
67
|
+
require 'pry'; return if command.nil?
|
|
68
68
|
|
|
69
69
|
with_retries { @runner = ::Docker::Container.get(instance_name, {}, docker_connection) }
|
|
70
70
|
with_retries do
|
|
@@ -75,58 +75,58 @@ module Kitchen
|
|
|
75
75
|
raise Transport::DockerExecFailed, "Docker Exec (#{@exit_code}) for command: [#{command}]" if @exit_code != 0
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
78
|
+
def upload(locals, remote)
|
|
79
|
+
port = options[:data_container][:NetworkSettings][:Ports][:"22/tcp"][0][:HostPort]
|
|
80
|
+
|
|
81
|
+
if options[:host_ip_override]
|
|
82
|
+
# Allow connecting to any ip/hostname to support sibling containers
|
|
83
|
+
ip = options[:host_ip_override]
|
|
84
|
+
elsif options[:docker_host_url] =~ /unix:/
|
|
85
|
+
if options[:data_container][:NetworkSettings][:Ports][:"22/tcp"][0][:HostIp] == '0.0.0.0'
|
|
86
|
+
ip = options[:data_container][:NetworkSettings][:IPAddress]
|
|
87
|
+
port = '22'
|
|
88
|
+
else
|
|
89
|
+
# we should read the proper mapped ip, since this allows us to upload the files
|
|
90
|
+
ip = options[:data_container][:NetworkSettings][:Ports][:"22/tcp"][0][:HostIp]
|
|
91
|
+
end
|
|
92
|
+
elsif options[:docker_host_url] =~ /tcp:/
|
|
93
|
+
ip = options[:docker_host_url].split('tcp://')[1].split(':')[0]
|
|
94
|
+
else
|
|
95
|
+
raise Kitchen::UserError, 'docker_host_url must be tcp:// or unix://'
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
tmpdir = Dir.tmpdir
|
|
99
|
+
FileUtils.mkdir_p "#{tmpdir}/dokken"
|
|
100
|
+
File.write("#{tmpdir}/dokken/id_rsa", insecure_ssh_private_key)
|
|
101
|
+
FileUtils.chmod(0600, "#{tmpdir}/dokken/id_rsa")
|
|
102
|
+
|
|
103
|
+
begin
|
|
104
|
+
rsync_cmd = '/usr/bin/rsync -a -e'
|
|
105
|
+
rsync_cmd << ' \''
|
|
106
|
+
rsync_cmd << 'ssh -2'
|
|
107
|
+
rsync_cmd << " -i #{tmpdir}/dokken/id_rsa"
|
|
108
|
+
rsync_cmd << ' -o CheckHostIP=no'
|
|
109
|
+
rsync_cmd << ' -o Compression=no'
|
|
110
|
+
rsync_cmd << ' -o PasswordAuthentication=no'
|
|
111
|
+
rsync_cmd << ' -o StrictHostKeyChecking=no'
|
|
112
|
+
rsync_cmd << ' -o UserKnownHostsFile=/dev/null'
|
|
113
|
+
rsync_cmd << ' -o LogLevel=ERROR'
|
|
114
|
+
rsync_cmd << " -p #{port}"
|
|
115
|
+
rsync_cmd << '\''
|
|
116
|
+
rsync_cmd << " #{locals.join(' ')} root@#{ip}:#{remote}"
|
|
117
|
+
`#{rsync_cmd}`
|
|
118
|
+
rescue Errno::ENOENT
|
|
119
|
+
debug 'Rsync is not installed. Falling back to SCP.'
|
|
120
|
+
locals.each do |local|
|
|
121
|
+
Net::SCP.upload!(ip,
|
|
122
|
+
'root',
|
|
123
|
+
local,
|
|
124
|
+
remote,
|
|
125
|
+
recursive: true,
|
|
126
|
+
ssh: { port: port, keys: ["#{tmpdir}/dokken/id_rsa"] })
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
130
|
|
|
131
131
|
def login_command
|
|
132
132
|
@runner = options[:instance_name].to_s
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-dokken
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean OMeara
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-01-
|
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: test-kitchen
|