kitchen-nodes 0.2.0.dev.4 → 0.2.0

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: 3825a42fb25e677e054965870384e1da18d64dec
4
- data.tar.gz: 3dfe8c256343b351109ec5e4fc60bddc5262646f
3
+ metadata.gz: da461052591bdff16f395e67bd2bd645a934b544
4
+ data.tar.gz: 4c57d3985ade375441b74038979db4fdda240431
5
5
  SHA512:
6
- metadata.gz: b107538a2b9a6207bd4227d7a0401acc231ad1995b99f8ea95e330ebf620786268924c6d4bcf5e02377e4890902b79d98daacd5579268c5d2021c22a84cc9924
7
- data.tar.gz: 0584e8e4446ac9788c08870eb0dae5c50cbfb57bcc3bad3cbe1b96b0fb855db55d6b04b87bd10946c14b724b042156700550b2fbe67952c9b363921ed59e6b54
6
+ metadata.gz: c2c09cfb781316b8859b0cce26d83ed276013a9ddc019cea39b822eb96626c97444eac548495d924f3f054d6f0a7ce276a1f3b3f618ac63934fc1d6eb20c4595
7
+ data.tar.gz: c6f3d25e203197b2ee709232181f05e4983047c47454d115f1641bbbe289937acc550d42407a4b5603b8dfc0a26c7edf337df0fe5d17e4a8f292f127133208a3
data/README.md CHANGED
@@ -2,18 +2,81 @@
2
2
 
3
3
  A Test Kitchen Provisioner that generates searchable Nodes.
4
4
 
5
+ The nodes provisioner extends the `chef-zero` provisioner along with all of its functionality and configuration. `chef-zero` can support chef searches by querying against node data stored in json files inside of the kitchen `nodes` folder. The `kitchen-nodes` plugin automatically generates a node file when a test instance is provisioned by test-kitchen.
6
+
7
+ ### Example nodes:
8
+
9
+ ```
10
+ {
11
+ "id": "server-community-ubuntu-1204",
12
+ "automatic": {
13
+ "ipaddress": "172.17.0.8",
14
+ "platform": "ubuntu"
15
+ },
16
+ "run_list": [
17
+ "recipe[apt]",
18
+ "recipe[couchbase-tests::ipaddress]",
19
+ "recipe[couchbase::server]",
20
+ "recipe[export-node]"
21
+ ]
22
+ }
23
+
24
+ {
25
+ "id": "second-node-ubuntu-1204",
26
+ "automatic": {
27
+ "ipaddress": "172.17.0.9",
28
+ "platform": "ubuntu"
29
+ },
30
+ "run_list": [
31
+ "recipe[apt]",
32
+ "recipe[couchbase-tests::ipaddress]",
33
+ "recipe[couchbase-tests::default]",
34
+ "recipe[export-node]"
35
+ ]
36
+ }
37
+ ```
38
+
5
39
  ## <a name="installation"></a> Installation and Setup
6
40
 
7
41
  Please read the [Driver usage][driver_usage] page for more details.
8
42
 
9
43
  ## <a name="config"></a> Configuration
10
44
 
45
+ Use `nodes` instead of `chef-zero` for the kitchen provisioner name.
46
+
11
47
  ```
12
48
  provisioner:
13
49
  name: nodes
14
50
  ```
15
51
 
16
- The nodes provisioner extends the `chef-zero` provisioner along with all of its functionality and configuration.
52
+ ## <a name="installation"></a> Usage
53
+
54
+ Using `kitchen-nodes` one can expect all previously converged nodes to be represented in a node file and be searchable. For example consider this scenario looking for a primary node in a cluster in order to add a node to join:
55
+
56
+ ```
57
+ require 'timeout'
58
+
59
+ def search_for_nodes(query, timeout = 120)
60
+ nodes = []
61
+ Timeout::timeout(timeout) do
62
+ nodes = search(:node, query)
63
+ until nodes.count > 0 && nodes[0].has_key?('ipaddress')
64
+ sleep 5
65
+ nodes = search(:node, query)
66
+ end
67
+ end
68
+
69
+ if nodes.count == 0 || !nodes[0].has_key?('ipaddress')
70
+ raise "Unable to find nodes!"
71
+ end
72
+
73
+ nodes
74
+ end
75
+
76
+ primary = search_for_nodes("run_list:*couchbase??server* AND platform:#{node['platform']}")
77
+ node.normal["couchbase-tests"]["primary_ip"] = primary[0]['ipaddress']
78
+
79
+ ```
17
80
 
18
81
  ## <a name="development"></a> Development
19
82
 
@@ -39,9 +102,9 @@ Created and maintained by [Matt Wrock][author] (<matt@mattwrock.com>)
39
102
  Apache 2.0 (see [LICENSE][license])
40
103
 
41
104
 
42
- [author]: https://github.com/enter-github-user
43
- [issues]: https://github.com/enter-github-user/kitchen-nodes/issues
44
- [license]: https://github.com/enter-github-user/kitchen-nodes/blob/master/LICENSE
45
- [repo]: https://github.com/enter-github-user/kitchen-nodes
105
+ [author]: https://github.com/mwrock
106
+ [issues]: https://github.com/mwrock/kitchen-nodes/issues
107
+ [license]: https://github.com/mwrock/kitchen-nodes/blob/master/LICENSE
108
+ [repo]: https://github.com/mwrock/kitchen-nodes
46
109
  [driver_usage]: http://docs.kitchen-ci.org/drivers/usage
47
110
  [chef_omnibus_dl]: http://www.getchef.com/chef/install/
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Provisioner
22
22
 
23
23
  # Version string for Nodes Kitchen driver
24
- NODES_VERSION = "0.2.0.dev.4"
24
+ NODES_VERSION = "0.2.0"
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-nodes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.dev.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wrock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-16 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ping
@@ -144,9 +144,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - ">"
147
+ - - ">="
148
148
  - !ruby/object:Gem::Version
149
- version: 1.3.1
149
+ version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
152
  rubygems_version: 2.4.1