kitchen-docker 1.5.0 → 1.6.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: b20641569c431d2c7ad9aee8ce47ae6e594f0094
4
- data.tar.gz: 4141179aa94c5c3f4edc8b58c9eb48c6502173a2
3
+ metadata.gz: 8345bffbaf637c87a99f8160ff212ce76444c92d
4
+ data.tar.gz: 7a813c9f5eef3fab3bde68284c6c0428e633946e
5
5
  SHA512:
6
- metadata.gz: 12afef7fe2ef9c9b6c79958efdf70fce090bcc1223e98558b675adc13d7641f1776cde221f4c7b9e07e699b037db2a3037b0f99bf80b882d9ea03426b7be1723
7
- data.tar.gz: e685af341d2baffeaaf9dbc59be8056a5d7932ea982b241dd0b96303c8b6d42fc206681e4b95194ed755ebd8135e3750486772723fd0b0a141f03a3ba52cab0e
6
+ metadata.gz: 4873d4dc1caaaaf7e90b434f55d609ef948ae2e143a98f36431aab13b55ad70bf5b73c0495226cfc2b2035147e218b01e689d5c0de0b096429d986f4be9f16a4
7
+ data.tar.gz: 47e0fb372d326ce9083335da3b6cd4a0ef8cc87539e294b0860034a007cb67c4668b6e1667429429e7a39fd04455195c9458bf02659f648ed96f8a60c9d1f81c
@@ -1,15 +1,16 @@
1
1
  ---
2
2
  driver:
3
3
  name: docker
4
- provision_command: curl -L http://www.opscode.com/chef/install.sh | bash
4
+ provision_command: curl -L http://www.chef.io/chef/install.sh | bash
5
5
 
6
6
  provisioner:
7
7
  name: dummy
8
8
 
9
9
  platforms:
10
10
  - name: ubuntu-12.04
11
- - name: ubuntu-13.10
11
+ - name: ubuntu-14.04
12
12
  - name: centos-6.4
13
+ - name: centos-7
13
14
  - name: debian
14
15
  - name: arch
15
16
  driver:
@@ -24,6 +25,17 @@ platforms:
24
25
  password: dockerfile
25
26
  dockerfile: test/Dockerfile
26
27
  run_command: /sbin/init
28
+ - name: database
29
+ driver:
30
+ image: ubuntu:14.04
31
+ platform: ubuntu
32
+ instance_name: db
33
+ publish_all: true
34
+ - name: linked
35
+ driver:
36
+ image: ubuntu:14.04
37
+ platform: ubuntu
38
+ links: "db:db"
27
39
 
28
40
  suites:
29
41
  - name: default
@@ -1,3 +1,17 @@
1
- ## 0.1.0 / Unreleased
1
+ ## 1.6.0
2
2
 
3
- * Initial release
3
+ * `publish_all` option to publish all ports to the host interface
4
+
5
+ * `instance_name` option to name the docker container
6
+
7
+ * `links` option to link suite instance docker containers
8
+
9
+ * `socket` option will now default to ENV `DOCKER_HOST` if set
10
+
11
+ * Fixed verify dependencies output redirection
12
+
13
+ * Added `fedora` to platform names
14
+
15
+ * Support for `gentoo` and `gentoo-paludis` platforms
16
+
17
+ * Adding sudo rule to `/etc/sudoers.d/#{username}` in addition to `/etc/sudoers`
data/README.md CHANGED
@@ -94,6 +94,13 @@ Examples:
94
94
  socket: tcp://docker.example.com:4242
95
95
  ```
96
96
 
97
+ If you use [Boot2Docker](https://github.com/boot2docker/boot2docker), set your `DOCKER_HOST` environment variable properly (e.g. `export DOCKER_HOST=tcp://192.168.59.103:2375`) or you have to use the following:
98
+
99
+ ```
100
+ socket: tcp://192.168.59.103:2375
101
+ ```
102
+
103
+
97
104
  ### image
98
105
 
99
106
  The Docker image to use as the base for the suite containers. You can find
@@ -109,6 +116,7 @@ suite container for Test Kitchen. Kitchen Docker currently supports:
109
116
 
110
117
  * `debian` or `ubuntu`
111
118
  * `rhel` or `centos`
119
+ * `gentoo` or `gentoo-paludis`
112
120
 
113
121
  The default will be computed, using the platform name (see the Default
114
122
  Configuration section for more details).
@@ -165,6 +173,14 @@ containers.
165
173
 
166
174
  The default value is `true`.
167
175
 
176
+ ### use\_sudo
177
+
178
+ This determines if Docker commands are run with `sudo`.
179
+
180
+ The default value depends on the type of socket being used. For local sockets, the default value is `true`. For remote sockets, the default value is `false`.
181
+
182
+ This should be set to `false` if you're using boot2docker, as every command passed into the VM runs as root by default.
183
+
168
184
  ### remove\_images
169
185
 
170
186
  This determines if images are automatically removed when the suite container is
@@ -176,7 +192,7 @@ The default value is `false`.
176
192
 
177
193
  Sets the command used to run the suite container.
178
194
 
179
- The default value is `/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no`.
195
+ The default value is `/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes`.
180
196
 
181
197
  Examples:
182
198
 
@@ -210,7 +226,24 @@ Examples:
210
226
  - /srv
211
227
  ```
212
228
 
213
- ## dns
229
+ ### volumes_from
230
+
231
+ Mount volumes managed by other containers.
232
+
233
+ Examples:
234
+
235
+ ```
236
+ volumes_from: repos
237
+ ```
238
+
239
+ ```
240
+ volumes_from:
241
+ - repos
242
+ - logging
243
+ - rvm
244
+ ```
245
+
246
+ ### dns
214
247
 
215
248
  Adjusts `resolv.conf` to use the dns servers specified. Otherwise use
216
249
  Dockers defaults.
@@ -228,7 +261,7 @@ Examples:
228
261
  ```
229
262
  ### http\_proxy
230
263
 
231
- Sets an http proxy for the suite container using the `http_proxy` environment variable.
264
+ Sets an http proxy for the suite container using the `http_proxy` environment variable.
232
265
 
233
266
  Examples:
234
267
 
@@ -294,6 +327,47 @@ Examples:
294
327
  dockerfile: test/Dockerfile
295
328
  ```
296
329
 
330
+ ### instance_name
331
+
332
+ Set the name of container to link to other container(s).
333
+
334
+ Examples:
335
+
336
+ ```
337
+ instance_name: web
338
+ ```
339
+
340
+ ### links
341
+
342
+ Set ```instance_name```(and alias) of other container(s) that connect from the suite container.
343
+
344
+ Examples:
345
+
346
+ ```
347
+ links: db:db
348
+ ```
349
+
350
+ Examples:
351
+
352
+ ```
353
+ links:
354
+ - db:db
355
+ - kvs:kvs
356
+ ```
357
+
358
+ ### publish_all
359
+
360
+ Publish all exposed ports to the host interfaces.
361
+ This option used to communicate between some containers.
362
+
363
+ The default value is `false`.
364
+
365
+ Examples:
366
+
367
+ ```
368
+ publish_all: true
369
+ ```
370
+
297
371
  ## Development
298
372
 
299
373
  * Source hosted at [GitHub][repo]
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Kitchen::Driver::DOCKER_VERSION
9
9
  spec.authors = ['Sean Porter']
10
10
  spec.email = ['portertech@gmail.com']
11
- spec.description = %q{A Test Kitchen Driver for Docker}
11
+ spec.description = %q{A Docker Driver for Test Kitchen}
12
12
  spec.summary = spec.description
13
13
  spec.homepage = 'https://github.com/portertech/kitchen-docker'
14
14
  spec.license = 'Apache 2.0'
@@ -29,11 +29,12 @@ module Kitchen
29
29
  class Docker < Kitchen::Driver::SSHBase
30
30
 
31
31
  default_config :binary, 'docker'
32
- default_config :socket, 'unix:///var/run/docker.sock'
32
+ default_config :socket, ENV['DOCKER_HOST'] || 'unix:///var/run/docker.sock'
33
33
  default_config :privileged, false
34
34
  default_config :use_cache, true
35
35
  default_config :remove_images, false
36
- default_config :run_command, '/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o UsePrivilegeSeparation=no -o PidFile=/tmp/sshd.pid'
36
+ default_config :run_command, '/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes ' +
37
+ '-o UsePrivilegeSeparation=no -o PidFile=/tmp/sshd.pid'
37
38
  default_config :username, 'kitchen'
38
39
  default_config :password, 'kitchen'
39
40
  default_config :tls, false
@@ -41,6 +42,7 @@ module Kitchen
41
42
  default_config :tls_cacert, nil
42
43
  default_config :tls_cert, nil
43
44
  default_config :tls_key, nil
45
+ default_config :publish_all, false
44
46
 
45
47
  default_config :use_sudo do |driver|
46
48
  !driver.remote_socket?
@@ -57,7 +59,7 @@ module Kitchen
57
59
  default_config :disable_upstart, true
58
60
 
59
61
  def verify_dependencies
60
- run_command("#{config[:binary]} > /dev/null", :quiet => true)
62
+ run_command("#{config[:binary]} >> /dev/null 2>&1", :quiet => true)
61
63
  rescue
62
64
  raise UserError,
63
65
  'You must first install the Docker CLI tool http://www.docker.io/gettingstarted/'
@@ -125,7 +127,7 @@ module Kitchen
125
127
  RUN apt-get install -y sudo openssh-server curl lsb-release
126
128
  eos
127
129
  config[:disable_upstart] ? disable_upstart + packages : packages
128
- when 'rhel', 'centos'
130
+ when 'rhel', 'centos', 'fedora'
129
131
  <<-eos
130
132
  RUN yum clean all
131
133
  RUN yum install -y sudo openssh-server openssh-clients which curl
@@ -139,6 +141,20 @@ module Kitchen
139
141
  RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
140
142
  RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
141
143
  eos
144
+ when 'gentoo'
145
+ <<-eos
146
+ RUN emerge sync
147
+ RUN emerge net-misc/openssh app-admin/sudo
148
+ RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
149
+ RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
150
+ eos
151
+ when 'gentoo-paludis'
152
+ <<-eos
153
+ RUN cave sync
154
+ RUN cave resolve -zx net-misc/openssh app-admin/sudo
155
+ RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
156
+ RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
157
+ eos
142
158
  else
143
159
  raise ActionFailed,
144
160
  "Unknown platform '#{config[:platform]}'"
@@ -149,6 +165,7 @@ module Kitchen
149
165
  RUN useradd -d /home/#{username} -m -s /bin/bash #{username}
150
166
  RUN echo #{username}:#{password} | chpasswd
151
167
  RUN echo '#{username} ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
168
+ RUN echo '#{username} ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/#{username}
152
169
  eos
153
170
  custom = ''
154
171
  Array(config[:provision_command]).each do |cmd|
@@ -199,6 +216,9 @@ module Kitchen
199
216
  Array(config[:dns]).each {|dns| cmd << " -dns #{dns}"}
200
217
  Array(config[:volume]).each {|volume| cmd << " -v #{volume}"}
201
218
  Array(config[:volumes_from]).each {|container| cmd << " --volumes-from #{container}"}
219
+ Array(config[:links]).each {|link| cmd << " --link #{link}"}
220
+ cmd << " --name #{config[:instance_name]}" if config[:instance_name]
221
+ cmd << " -P" if config[:publish_all]
202
222
  cmd << " -h #{config[:hostname]}" if config[:hostname]
203
223
  cmd << " -m #{config[:memory]}" if config[:memory]
204
224
  cmd << " -c #{config[:cpu]}" if config[:cpu]
@@ -19,6 +19,6 @@ module Kitchen
19
19
  module Driver
20
20
 
21
21
  # Version string for Docker Kitchen driver
22
- DOCKER_VERSION = "1.5.0"
22
+ DOCKER_VERSION = "1.6.0"
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: A Test Kitchen Driver for Docker
97
+ description: A Docker Driver for Test Kitchen
98
98
  email:
99
99
  - portertech@gmail.com
100
100
  executables: []
@@ -137,10 +137,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.2.0
140
+ rubygems_version: 2.2.2
141
141
  signing_key:
142
142
  specification_version: 4
143
- summary: A Test Kitchen Driver for Docker
143
+ summary: A Docker Driver for Test Kitchen
144
144
  test_files:
145
145
  - test/Dockerfile
146
146
  - test/integration/default/serverspec/default_spec.rb