kitchen-docker_cli 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +11 -0
- data/lib/kitchen/driver/docker_cli.rb +6 -1
- data/lib/kitchen/driver/docker_cli_version.rb +1 -1
- data/spec/kitchen/driver/docker_cli_spec.rb +14 -1
- 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: 67692c61b4cd109d6454fa31f8d25e28f70bc901
|
4
|
+
data.tar.gz: 19e7c9629cafc3a90ee405ca1d4167f692fde894
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dfe3bd361b618bb3579d11a909ce37b208a3d29c35a63a19e4bbb6b4e0c24d516acddff8415190fa74d91f74654ecba5ba313b25b163f69b74b9900272b1e6a
|
7
|
+
data.tar.gz: e5e58fd795a5416547c295de30e032642aa81aa72bf32d59ad772d18c779ddc19686add4b05f15ab70da1ce626870339c980fd4bf930a609522f53935c9dc5c6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -174,6 +174,17 @@ Examples:
|
|
174
174
|
hostname: example.local
|
175
175
|
```
|
176
176
|
|
177
|
+
### instance_host_name
|
178
|
+
Use instance name to hostname.
|
179
|
+
|
180
|
+
The default value is `false`.
|
181
|
+
|
182
|
+
Examples:
|
183
|
+
|
184
|
+
```yml
|
185
|
+
instance_host_name: true
|
186
|
+
```
|
187
|
+
|
177
188
|
### link
|
178
189
|
|
179
190
|
Set `container_name`(and alias) of other container(s) that connect from the suite container.
|
@@ -30,6 +30,7 @@ module Kitchen
|
|
30
30
|
default_config :no_cache, false
|
31
31
|
default_config :command, 'sh -c \'while true; do sleep 1d; done;\''
|
32
32
|
default_config :privileged, false
|
33
|
+
default_config :instance_host_name, false
|
33
34
|
|
34
35
|
default_config :image do |driver|
|
35
36
|
driver.default_image
|
@@ -132,7 +133,11 @@ module Kitchen
|
|
132
133
|
cmd << " -c #{config[:cpu_shares]}" if config[:cpu_shares]
|
133
134
|
cmd << ' --privileged' if config[:privileged]
|
134
135
|
cmd << " --net #{config[:network]}" if config[:network]
|
135
|
-
|
136
|
+
if config[:hostname]
|
137
|
+
cmd << " -h #{config[:hostname]}"
|
138
|
+
elsif config[:instance_host_name]
|
139
|
+
cmd << " -h #{instance.name}"
|
140
|
+
end
|
136
141
|
Array(config[:publish]).each { |pub| cmd << " -p #{pub}" }
|
137
142
|
Array(config[:volume]).each { |vol| cmd << " -v #{vol}" }
|
138
143
|
Array(config[:link]).each { |link| cmd << " --link #{link}" }
|
@@ -218,6 +218,9 @@ describe Kitchen::Driver::DockerCli, "docker_run_command" do
|
|
218
218
|
|
219
219
|
before do
|
220
220
|
@docker_cli = Kitchen::Driver::DockerCli.new(config)
|
221
|
+
instance = double('instance')
|
222
|
+
instance.stub(:name).and_return("default-centos-66")
|
223
|
+
@docker_cli.stub(:instance).and_return(instance)
|
221
224
|
end
|
222
225
|
|
223
226
|
context 'default' do
|
@@ -229,6 +232,15 @@ describe Kitchen::Driver::DockerCli, "docker_run_command" do
|
|
229
232
|
end
|
230
233
|
end
|
231
234
|
|
235
|
+
context 'instance_host_name' do
|
236
|
+
let(:config) { {:command => '/bin/bash', :instance_host_name => true} }
|
237
|
+
|
238
|
+
example do
|
239
|
+
cmd = "run -d -t -h default-centos-66 test /bin/bash"
|
240
|
+
expect(@docker_cli.docker_run_command('test')).to eq cmd
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
232
244
|
context 'set configs' do
|
233
245
|
let(:config) do
|
234
246
|
{
|
@@ -242,7 +254,8 @@ describe Kitchen::Driver::DockerCli, "docker_run_command" do
|
|
242
254
|
:memory_limit => '256m',
|
243
255
|
:cpu_shares => 512,
|
244
256
|
:network => 'none',
|
245
|
-
:hostname => 'example.local'
|
257
|
+
:hostname => 'example.local',
|
258
|
+
:instance_host_name => true
|
246
259
|
}
|
247
260
|
end
|
248
261
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-docker_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masashi Terui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|