kitchen-dokken 2.0.15 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ea658582d40c59d0d4c3b6a3c9e01891ab040fd
4
- data.tar.gz: ee80b003cabe762511bb860eeaed930929200c66
3
+ metadata.gz: ae03351629cd98963f4235e2aeeeded8e100d404
4
+ data.tar.gz: 92d2e6f1d1d377023fc76b8580a0701813ac0e8f
5
5
  SHA512:
6
- metadata.gz: 753bc2011e71b6a336c38e1235f6674b7c76454394e801ec444dc97a6f0ab91448641694c435529bb936f12131044484ca801156ba27d6a2835fc66b7646d8c8
7
- data.tar.gz: 44de7645a8171f9bb87ee903c0d6f595f93d965023611ccf62c11e535e2325b737085cd0af90b24a896aeb6f3da766df01e6ee03e978a8429e8db0984baca1dc
6
+ metadata.gz: 3552cfc7d31dfaae91ed8d3119cdc1f13d40c03bd59f9ddf0adc2bd9c3d0068723e8f513f17bce299ff218aa1525ed49f669e4ba697bc596226127c5919ebd2c
7
+ data.tar.gz: 611860a71e2ca679a19c09251b5b26924f9e08e5c645abb5c62e08871ba33d139460e8f130ae77dd5ba17e41d6a204ee3cb0b2db5ba6c5810d1f197e02e6a176
@@ -201,7 +201,8 @@ module Kitchen
201
201
 
202
202
  def dokken_binds
203
203
  ret = []
204
- ret << "#{dokken_sandbox_path}:/opt/kitchen" unless dokken_sandbox_path.nil?
204
+ ret << "#{dokken_kitchen_sandbox}:/opt/kitchen" unless dokken_kitchen_sandbox.nil?
205
+ ret << "#{dokken_verifier_sandbox}:/opt/verifier" unless dokken_verifier_sandbox.nil?
205
206
  ret << Array(config[:binds]) unless config[:binds].nil?
206
207
  ret.flatten
207
208
  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.0.15'.freeze
22
+ DOKKEN_VERSION = '2.1.0'.freeze
23
23
  end
24
24
  end
@@ -89,28 +89,48 @@ EOF
89
89
  end
90
90
 
91
91
  def dokken_create_sandbox
92
- info("Creating local sandbox at #{dokken_sandbox_path}")
93
- FileUtils.mkdir_p(dokken_sandbox_path)
94
- File.chmod(0755, dokken_sandbox_path)
92
+ info("Creating kitchen sandbox at #{dokken_kitchen_sandbox}")
93
+ FileUtils.mkdir_p(dokken_kitchen_sandbox)
94
+ File.chmod(0755, dokken_kitchen_sandbox)
95
+
96
+ info("Creating verifier sandbox at #{dokken_verifier_sandbox}")
97
+ FileUtils.mkdir_p(dokken_verifier_sandbox)
98
+ File.chmod(0755, dokken_verifier_sandbox)
95
99
  end
96
100
 
97
101
  def dokken_delete_sandbox
98
- info("Deleting local sandbox at #{dokken_sandbox_path}")
102
+ info("Deleting kitchen sandbox at #{dokken_kitchen_sandbox}")
103
+ begin
104
+ FileUtils.rm_rf(dokken_kitchen_sandbox)
105
+ rescue Errno::ENOENT
106
+ debug("Cannot delete #{dokken_kitchen_sandbox}. Does not exist")
107
+ end
108
+
109
+ info("Deleting verifier sandbox at #{dokken_verifier_sandbox}")
99
110
  begin
100
- FileUtils.rm_rf(dokken_sandbox_path)
111
+ FileUtils.rm_rf(dokken_verifier_sandbox)
101
112
  rescue Errno::ENOENT
102
- debug("Cannot delete #{dokken_sandbox_path}. Does not exist")
113
+ debug("Cannot delete #{dokken_verifier_sandbox}. Does not exist")
103
114
  end
104
115
  end
105
116
 
106
- def dokken_sandbox_path
107
- "#{Dir.home}/.dokken/sandbox/#{instance_name}"
117
+ def dokken_kitchen_sandbox
118
+ "#{Dir.home}/.dokken/kitchen_sandbox/#{instance_name}"
119
+ end
120
+
121
+ def dokken_verifier_sandbox
122
+ "#{Dir.home}/.dokken/verifier_sandbox/#{instance_name}"
108
123
  end
109
124
 
110
125
  def instance_name
111
126
  prefix = (Digest::SHA2.hexdigest FileUtils.pwd)[0, 10]
112
127
  "#{prefix}-#{instance.name}"
113
128
  end
129
+
130
+ def remote_docker_host?
131
+ return true if config[:docker_host_url] =~ /^tcp:/
132
+ false
133
+ end
114
134
  end
115
135
  end
116
136
 
@@ -118,13 +138,14 @@ module Kitchen
118
138
  module Provisioner
119
139
  class Base
120
140
  def create_sandbox
121
- info("Creating local sandbox in #{sandbox_path}")
141
+ info("Creating kitchen sandbox in #{sandbox_path}")
122
142
  FileUtils.mkdir_p(sandbox_path)
123
143
  File.chmod(0755, sandbox_path)
124
144
  end
125
145
 
146
+ # this MUST be named 'sandbox_path' because ruby.
126
147
  def sandbox_path
127
- "#{Dir.home}/.dokken/sandbox/#{instance_name}"
148
+ "#{Dir.home}/.dokken/kitchen_sandbox/#{instance_name}"
128
149
  end
129
150
 
130
151
  def instance_name
@@ -134,3 +155,36 @@ module Kitchen
134
155
  end
135
156
  end
136
157
  end
158
+
159
+ module Kitchen
160
+ module Verifier
161
+ class Base
162
+ def create_sandbox
163
+ info("Creating kitchen sandbox in #{sandbox_path}")
164
+ FileUtils.mkdir_p(sandbox_path)
165
+ File.chmod(0755, sandbox_path)
166
+ end
167
+
168
+ def sandbox_path
169
+ "#{Dir.home}/.dokken/verifier_sandbox/#{instance_name}"
170
+ end
171
+
172
+ def instance_name
173
+ prefix = (Digest::SHA2.hexdigest FileUtils.pwd)[0, 10]
174
+ "#{prefix}-#{instance.name}"
175
+ end
176
+
177
+ def call(state)
178
+ instance.transport.connection(state) do |conn|
179
+ conn.execute(install_command)
180
+ conn.execute(prepare_command)
181
+ conn.execute(run_command)
182
+ end
183
+ rescue Kitchen::Transport::TransportFailed => ex
184
+ raise ActionFailed, ex.message
185
+ ensure
186
+ cleanup_sandbox
187
+ end
188
+ end
189
+ end
190
+ end
@@ -62,12 +62,8 @@ module Kitchen
62
62
 
63
63
  # if the user wants to be funny and pass empty strings
64
64
  # just use the defaults
65
- if config[:chef_log_level].empty?
66
- config[:chef_log_level] = 'warn'
67
- end
68
- if config[:chef_output_format].empty?
69
- config[:chef_output_format] = 'doc'
70
- end
65
+ config[:chef_log_level] = 'warn' if config[:chef_log_level].empty?
66
+ config[:chef_output_format] = 'doc' if config[:chef_output_format].empty?
71
67
  end
72
68
 
73
69
  private
@@ -96,9 +96,9 @@ module Kitchen
96
96
  end
97
97
 
98
98
  tmpdir = Dir.tmpdir + '/dokken/'
99
- FileUtils.mkdir_p "#{tmpdir}", :mode => 0777
99
+ FileUtils.mkdir_p tmpdir.to_s, mode: 0777
100
100
  tmpdir += Process.uid.to_s
101
- FileUtils.mkdir_p "#{tmpdir}"
101
+ FileUtils.mkdir_p tmpdir.to_s
102
102
  File.write("#{tmpdir}/id_rsa", insecure_ssh_private_key)
103
103
  FileUtils.chmod(0600, "#{tmpdir}/id_rsa")
104
104
 
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.15
4
+ version: 2.1.0
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-02-15 00:00:00.000000000 Z
11
+ date: 2017-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen