kitchen-zcloudjp 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTE1NWFmYmU0MjlkZjExM2U4Y2UyNjcwNWM3OTc0NGNhY2VhOGE0ZQ==
4
+ MjkwMDVmMDk0MzMyMTdiN2JkOTgwY2NjNDRhNDkwZWEyNzM5Y2I2Yw==
5
5
  data.tar.gz: !binary |-
6
- ZWZjMTQ3ZDdiMmUxNzQwNzUyNDdhODljY2I0ZTI0NzFiY2YyYTUzOQ==
6
+ ZDA0NmUyMzFiN2I5N2VhNDI5Y2MxZmQyYmY4NmUzNjQ0YTc1NTQxMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- M2MxNjljMTlmNGVjNDg4MDgxOGYxY2QwNWYyM2NkYWQzMGU0MGE5ZmEyNDE1
10
- MmE0YWM1OThkNTZkMTYyMTQ2M2IzMDJhOWMyMzY3YzZmZWMzMDU1NjYzYzhl
11
- YWFmYjJmNjk4N2FmMTc2YzE4N2IxNDViOGM3ZTZjMjdlYTMwYmM=
9
+ ZGE4NTVlZTExZjgxNTFkNWM5ZTQxMTc4ZTYwZGNmZjU0YWIzMzZiNDM5OGM5
10
+ YzkyY2U2ZmNjM2MyZGE5MmViNjg0NWQxOWRiNTc4YmQyOTIzNTdlMDY5NzYy
11
+ MmFkMzUxMjVlMzMzNTgwYjExMjhhMDUzNGIxNTZlNTFiNDEwNjg=
12
12
  data.tar.gz: !binary |-
13
- MjAzMzc2MmY3MzE3N2I0NmU0NThlZThiMmIzMGI1MDI5Mjg3ZjFiZjNiYmFm
14
- ZTRhYjMzNjZmNDEyNTc2MmZmN2Q5M2Y3NjJhZWE1NTc2MzRiMzMzNzFkMjJh
15
- ODU0MDJlMzc3ZGIyNDU4MDlhZGU1YTRmMWZiMzRlOTkwMmFkZTE=
13
+ YWE3ZmI4MTNiMzZjNjBiOTVmYTVhNzBiNGJmODAwYjdjMDgxZTQ4NWU2NDNm
14
+ NDNkYjhiY2I3YTgwYTI5ZjdkNDY0Yzc0Y2NhNWFkZDhkYmRhMWYzN2RhYTAz
15
+ OTZmYjFhNjQ3YWI4NDRhZjdhMzFiYmNkZGY0MmQ0MzhhZjUwNWY=
data/README.md CHANGED
@@ -31,26 +31,33 @@ Or install it yourself as:
31
31
  ## Configuration
32
32
 
33
33
 
34
- ### api_key
34
+ ### driver_config/api_key
35
35
 
36
36
  **Required** The Z Cloud(joyent) apikey to use.
37
37
 
38
38
  You can see an account section at [Z Cloud control panel](https://my.z-cloud.jp).
39
39
 
40
- ### dataset
40
+ ### platforms/name/driver_config/dataset
41
41
 
42
42
  The Z Cloud(joyent) dataset image to use.
43
43
 
44
44
  The default is SmartOS base64 image `sdc:sdc:base64:13.1.0`.
45
45
 
46
46
 
47
- ### package
47
+ ### platforms/name/driver_config/package
48
48
 
49
49
  The Z Cloud(joyent) smartmachine size to use.
50
50
 
51
51
  The default is `Small_1GB`.
52
52
 
53
- ### require_chef_omnibus
53
+ ### platforms/name/driver_config/metadata_file
54
+
55
+ The Z Cloud(joyent) smartmachine metadata to use.
56
+
57
+ The default is empty hash.
58
+
59
+
60
+ ### platforms/name/driver_config/require_chef_omnibus
54
61
 
55
62
  For `VirtualMachine` only option. Install chef from omnibus installer on boot.
56
63
 
@@ -73,6 +80,8 @@ driver_config:
73
80
 
74
81
  platforms:
75
82
  - name: smartos-base64
83
+ driver_config:
84
+ metadata_file: foo.json
76
85
  - name: ubuntu12
77
86
  driver_config:
78
87
  require_chef_omnibus: true
@@ -84,6 +93,16 @@ suites:
84
93
  attributes: {}
85
94
  ```
86
95
 
96
+ **Example:foo.json(metadata)**
97
+
98
+ Notice: values must be string.
99
+
100
+ ```
101
+ {
102
+ "user-script": "#!/bin/bash\nenv > /tmp/env_out",
103
+ "your_defined_key" : "some_data"
104
+ }
105
+ ```
87
106
 
88
107
 
89
108
  ## Product List (2013-07-09)
@@ -114,13 +114,24 @@ module Kitchen
114
114
  end
115
115
 
116
116
  def create_server(state)
117
+ debug(JSON.pretty_generate(config))
118
+ debug("Send as Metadata => #{build_metadata}")
117
119
  client.machine.create(
118
120
  :dataset => config[:dataset],
119
121
  :package => config[:package],
120
- :name => ['tk', @instance.suite.name.to_s, @instance.platform.name.to_s].join('-').slice(0,20)
122
+ :name => ['tk', @instance.suite.name.to_s, @instance.platform.name.to_s].join('-').slice(0,20),
123
+ :metadata => build_metadata
121
124
  )
122
125
  end
123
126
 
127
+ def build_metadata
128
+ if config[:metadata_file]
129
+ JSON.parse(::File.read(config[:metadata_file]))
130
+ else
131
+ {}
132
+ end
133
+ end
134
+
124
135
  def install_chef_for_smartos(ssh_args)
125
136
  ssh(ssh_args, <<-INSTALL.gsub(/^ {10}/, ''))
126
137
  if [ ! -f /opt/local/bin/chef-client ]; then
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Zcloudjp Test Kitchen driver
22
- ZCLOUDJP_VERSION = "0.1.6"
22
+ ZCLOUDJP_VERSION = "0.2.0"
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-zcloudjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-16 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -148,3 +148,4 @@ signing_key:
148
148
  specification_version: 4
149
149
  summary: A Test Kitchen Driver for Zcloudjp
150
150
  test_files: []
151
+ has_rdoc: