kitchen-docker 0.7.1 → 0.8.0.beta

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: 3e9aff9db5572dce0469136f6ba20b70d2c7cbf6
4
- data.tar.gz: e04deab4ef253772455ad52be33a9a55e834f61b
3
+ metadata.gz: 3615c90da12073ec10f579eca1779e0e4381aeeb
4
+ data.tar.gz: c97cda109cec9490e763074a26e798b1fd64136f
5
5
  SHA512:
6
- metadata.gz: ac7a686896597a8bbe731cd2b473292ac12c51463cc1f446f219e1b928e5bf39c762ce2505352ffcdf995c7f56d26c2897fafebfbd88fcbda4b1fe519c8150c0
7
- data.tar.gz: ae65111a3af9d683cdf730360e090b00fe40cb6f77cda350d3d2ff4aa44707b4fa126999b45971a7b0483a15034dd8a3db97291497c172719b71e460bd373dbe
6
+ metadata.gz: 798d6c1257b25ae6fa61ee5e7da670089bf8d0ccc441d72f94a0a67176fd804bfcbfa39f25040c457cbe657b1a65f0d49d093c3612300f19933f8740e7605820
7
+ data.tar.gz: 4402e96ea18f8a351f6720db5abd9b58446189358556bff5238de15e514475188bae54246a2d432c6f18ceb2e114b889d58ea3d2794eab847432491e872e2ba8
data/README.md CHANGED
@@ -32,6 +32,33 @@ platforms:
32
32
  - recipe[yum]
33
33
  ```
34
34
 
35
+ ## Default Configuration
36
+
37
+ This driver can determine an image and platform type for a select number of
38
+ platforms. Currently, the following platform names are supported:
39
+
40
+ ```
41
+ ---
42
+ platforms:
43
+ - name: ubuntu-12.04
44
+ - name: centos-6.4
45
+ ```
46
+
47
+ This will effectively generate a configuration similar to:
48
+
49
+ ```
50
+ ---
51
+ platforms:
52
+ - name: ubuntu-12.04
53
+ driver_config:
54
+ image: ubuntu:12.04
55
+ platform: ubuntu
56
+ - name: centos-6.4
57
+ driver_config:
58
+ image: centos:6.4
59
+ platform: centos
60
+ ```
61
+
35
62
  ## Configuration
36
63
 
37
64
  ### image
@@ -39,7 +66,10 @@ platforms:
39
66
  The Docker image to use as the base for the suite containers. You can find
40
67
  images using the [Docker Index][docker_index].
41
68
 
42
- The default value is `base`, an official Ubuntu [image][docker_default_image].
69
+ The default will be determined by the Platform name, if a default exists
70
+ (see the Default Configuration section for more details). If a default
71
+ cannot be computed, then the default value is `base`, an official Ubuntu
72
+ [image][docker_default_image].
43
73
 
44
74
  ### platform
45
75
 
@@ -49,7 +79,9 @@ suite container for Test Kitchen. Kitchen Docker currently supports:
49
79
  * `debian` or `ubuntu`
50
80
  * `rhel` or `centos`
51
81
 
52
- The default value is `ubuntu`.
82
+ The default will be determined by the Platform name, if a default exists
83
+ (see the Default Configuration section for more details). If a default
84
+ cannot be computed, then the default value is `ubuntu`.
53
85
 
54
86
  ### require\_chef\_omnibus
55
87
 
@@ -29,14 +29,18 @@ module Kitchen
29
29
  # @author Sean Porter <portertech@gmail.com>
30
30
  class Docker < Kitchen::Driver::SSHBase
31
31
 
32
- default_config :image, 'base'
33
- default_config :platform, 'ubuntu'
34
32
  default_config :port, '22'
35
33
  default_config :username, 'kitchen'
36
34
  default_config :password, 'kitchen'
37
35
  default_config :require_chef_omnibus, true
38
36
  default_config :remove_images, false
39
37
  default_config :use_sudo, true
38
+ default_config :image do |driver|
39
+ driver.default_image
40
+ end
41
+ default_config :platform do |driver|
42
+ driver.default_platform
43
+ end
40
44
 
41
45
  def verify_dependencies
42
46
  run_command('docker > /dev/null', :quiet => true)
@@ -45,6 +49,15 @@ module Kitchen
45
49
  'You must first install Docker http://www.docker.io/gettingstarted/'
46
50
  end
47
51
 
52
+ def default_image
53
+ platform, release = instance.platform.name.split('-')
54
+ release ? [platform, release].join(':') : 'base'
55
+ end
56
+
57
+ def default_platform
58
+ instance.platform.name.split('-').first || 'ubuntu'
59
+ end
60
+
48
61
  def create(state)
49
62
  state[:image_id] = build_image(state) unless state[:image_id]
50
63
  state[:container_id] = run_container(state) unless state[:container_id]
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Docker Kitchen driver
24
- DOCKER_VERSION = "0.7.1"
24
+ DOCKER_VERSION = "0.8.0.beta"
25
25
  end
26
26
  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: 0.7.1
4
+ version: 0.8.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-10 00:00:00.000000000 Z
11
+ date: 2013-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -128,9 +128,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - '>='
131
+ - - '>'
132
132
  - !ruby/object:Gem::Version
133
- version: '0'
133
+ version: 1.3.1
134
134
  requirements: []
135
135
  rubyforge_project:
136
136
  rubygems_version: 2.0.6