kitchen-dokken 2.1.8 → 2.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd87d062c7f883b08cfcf39b5e34ff90a6812f34
4
- data.tar.gz: 214d13b75716785c6c3f0d3ab3ffa290c1d95ecd
3
+ metadata.gz: 9ff9ae0aef7da46692d99db224bea980cb5abd73
4
+ data.tar.gz: 6105f417d480202d545176d77e40308acf94f82f
5
5
  SHA512:
6
- metadata.gz: ec19a0c8dada3d6c913c140b9e586a277bf572216cfd61fcacbf3ac12abf217e2a2c33146ef3d3c9da17bc266e4e0a9d0aceec1edab9453a87ada28241dd423f
7
- data.tar.gz: 9a591dced051bd240dc4fc4a87ff75f3f5edecd547e6eae807b6a6ab34fa64e645791333218ee3ab0dbe2f5e3aa189635ecc9a5d2f6f0cee9ec39446abc07027
6
+ metadata.gz: 8841985e9e70281e36997d08db94bd2577988559c533b8c169f7992614c378b834a2e337d1523efb4d7bd1add6bcbbfce4e659caf10cec251be2a9157391ff62
7
+ data.tar.gz: 51f876da1dbc8d3b2e1b8dc91046c34aaac392fc71c5ccb7dddc5e84a7806c1f10a90c7d3de1aa65cdde8aa8c204fce5be6715429f67f6bbfffe2acd2948c3f3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Dokken Changelog
2
2
 
3
+ # 2.1.9
4
+ - Various fixes around remote docker host usage
5
+
3
6
  # 2.1.8
4
7
  - Using user specified image_prefix in instance_name
5
8
 
@@ -95,11 +95,6 @@ module Kitchen
95
95
 
96
96
  private
97
97
 
98
- def remote_docker_host?
99
- return true if config[:docker_host_url] =~ /^tcp:/
100
- false
101
- end
102
-
103
98
  def api_retries
104
99
  config[:api_retries]
105
100
  end
@@ -201,8 +196,8 @@ module Kitchen
201
196
 
202
197
  def dokken_binds
203
198
  ret = []
204
- ret << "#{dokken_kitchen_sandbox}:/opt/kitchen" unless dokken_kitchen_sandbox.nil?
205
- ret << "#{dokken_verifier_sandbox}:/opt/verifier" unless dokken_verifier_sandbox.nil?
199
+ ret << "#{dokken_kitchen_sandbox}:/opt/kitchen" unless dokken_kitchen_sandbox.nil? || remote_docker_host?
200
+ ret << "#{dokken_verifier_sandbox}:/opt/verifier" unless dokken_verifier_sandbox.nil? || remote_docker_host?
206
201
  ret << Array(config[:binds]) unless config[:binds].nil?
207
202
  ret.flatten
208
203
  end
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Dokken Kitchen driver
22
- DOKKEN_VERSION = '2.1.8'.freeze
22
+ DOKKEN_VERSION = '2.1.9'.freeze
23
23
  end
24
24
  end
@@ -145,6 +145,22 @@ EOF
145
145
  return true if config[:docker_host_url] =~ /^tcp:/
146
146
  false
147
147
  end
148
+
149
+ def sandbox_path
150
+ "#{Dir.home}/.dokken/verifier_sandbox/#{instance_name}"
151
+ end
152
+
153
+ def sandbox_dirs
154
+ Dir.glob(File.join(sandbox_path, '*'))
155
+ end
156
+
157
+ def create_sandbox
158
+ info("Creating kitchen sandbox in #{sandbox_path}")
159
+ unless ::Dir.exist?(sandbox_path)
160
+ FileUtils.mkdir_p(sandbox_path)
161
+ File.chmod(0755, sandbox_path)
162
+ end
163
+ end
148
164
  end
149
165
  end
150
166
 
@@ -192,8 +208,6 @@ module Kitchen
192
208
 
193
209
  def call(state)
194
210
  create_sandbox
195
- sandbox_dirs = Dir.glob(File.join(sandbox_path, '*'))
196
-
197
211
  instance.transport.connection(state) do |conn|
198
212
  conn.execute(install_command)
199
213
 
@@ -35,11 +35,17 @@ module Kitchen
35
35
  default_config :chef_options, ' -z'
36
36
  default_config :chef_log_level, 'warn'
37
37
  default_config :chef_output_format, 'doc'
38
+ default_config :docker_host_url, default_docker_host
38
39
 
39
40
  # (see Base#call)
40
41
  def call(state)
41
42
  create_sandbox
42
43
  instance.transport.connection(state) do |conn|
44
+ if remote_docker_host?
45
+ info("Transferring files to #{instance.to_str}")
46
+ conn.upload(sandbox_dirs, config[:root_path])
47
+ end
48
+
43
49
  conn.execute(prepare_command)
44
50
  conn.execute_with_retry(
45
51
  run_command,
@@ -50,8 +56,8 @@ module Kitchen
50
56
  end
51
57
  rescue Kitchen::Transport::TransportFailed => ex
52
58
  raise ActionFailed, ex.message
53
- # ensure
54
- # cleanup_sandbox
59
+ ensure
60
+ cleanup_sandbox if remote_docker_host?
55
61
  end
56
62
 
57
63
  def validate_config
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.1.8
4
+ version: 2.1.9
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-06-09 00:00:00.000000000 Z
11
+ date: 2017-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen