kitchen-habitat 0.6.1 → 0.7.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: 4a7186aecdeb7d78328ba237f0f586a5bafcd010
4
- data.tar.gz: bcfcea1fe6c318ad4b132f2e34d9fe91503e6752
3
+ metadata.gz: 24e28546bbe3eb127598d6f93d8c283770a2ceb6
4
+ data.tar.gz: fb278ba7a725265367e588ff3e522ac17016c3c5
5
5
  SHA512:
6
- metadata.gz: cb291cfc369592c4fe43377f6c9d2a7bd26a454af682c41406281a38020063cccf9b16a2c9e161e60835ecddb054ec6be6bebf4eeb803863d1c13c49f423969e
7
- data.tar.gz: 848a9b1394ceecf32e6f7a51cc5378d91d57c023030508fcc820a88148190960f71f6d6aac7ca9fe1c53bf942479a420b0cd58acad3a0c68ac9e8150878e99cd
6
+ metadata.gz: 54e12cd0a926b6e7c978134000db2f33f8b5e15284f61fbec38fe6a71d7bc7549a9e5027ae20aba70b450407ef1e0e35a3a25642f2ea4f20cf46ec107c70c88b
7
+ data.tar.gz: 1cd47e9aee9bdee8179cae232627d3402787a7b2dc29c67692cb9f0358dfd882471bbd35888b33f3c22a47eac040a4b6ecd2c8e95518feeffd521eb48e6fff5d
data/README.md CHANGED
@@ -15,7 +15,7 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
15
15
 
16
16
  * `depot_url`
17
17
  * Target Habitat Depot to use to install packages.
18
- * Defaults to `nil` (which will use the default depot settings for the `hab` CLI).
18
+ * Defaults to `nil` (which will use the default depot settings for the `hab` CLI from ~/.hab/etc/cli.toml).
19
19
 
20
20
  ### Supervisor Settings
21
21
 
@@ -85,7 +85,7 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
85
85
  * Directory containing a user.toml or/and a default.toml, hooks, and configuration files to be passed to the service under test.
86
86
  * Defaults to `nil`
87
87
  * `override_package_config`
88
- * Tell the supervisor to the the configuration files and hooks from `config_directory` instead of what was packaged with the service. (Uses `--config-from` via the `hab-sup` CLI.)
88
+ * Tell the supervisor to load the the configuration files and hooks from `config_directory` instead of what was packaged with the service. (Uses `--config-from` via the `hab-sup` CLI.)
89
89
  * `user_toml_name`
90
90
  * Name of the file to be used as the user.toml for the service under test.
91
91
  * Defaults to `user.toml`
@@ -97,6 +97,8 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
97
97
 
98
98
  ## Examples
99
99
 
100
+ Run the core-redis package
101
+
100
102
  ```yaml
101
103
  driver:
102
104
  name: vagrant
@@ -114,3 +116,38 @@ platforms:
114
116
  suites:
115
117
  - name: default
116
118
  ```
119
+
120
+ Two node: elasticsearch and kibana
121
+
122
+ ```yaml
123
+ driver:
124
+ name: docker
125
+
126
+ provisioner:
127
+ name: habitat
128
+ hab_sup_origin: core
129
+ hab_sup_name: sup
130
+
131
+ platforms:
132
+ - name: ubuntu-16.04
133
+
134
+ suites:
135
+ - name: elasticsearch
136
+ provisioner:
137
+ package_origin: core
138
+ package_name: elasticsearch
139
+ driver:
140
+ instance_name: elastic
141
+
142
+ - name: kibana
143
+ provisioner:
144
+ package_origin: core
145
+ package_name: kibana
146
+ hab_sup_peer:
147
+ - elastic
148
+ hab_sup_bind:
149
+ - elasticsearch:elasticsearch.default
150
+ driver:
151
+ instance_name: kibana
152
+ links: elastic:elastic
153
+ ```
@@ -39,6 +39,7 @@ module Kitchen
39
39
  default_config :package_release, nil
40
40
  default_config :service_topology, nil
41
41
  default_config :service_update_strategy, nil
42
+ default_config :channel, "stable"
42
43
 
43
44
  # local stuffs to copy
44
45
  default_config :results_directory, nil
@@ -51,7 +52,7 @@ module Kitchen
51
52
 
52
53
  def finalize_config!(instance)
53
54
  # Check to see if a package ident was specified for package name and be helpful
54
- unless config[:package_name].nil? || (config[:package_name] =~ /\//).nil?
55
+ unless config[:package_name].nil? || (config[:package_name] =~ /\//).nil?
55
56
  config[:package_origin], config[:package_name], config[:package_version], config[:package_release] = config[:package_name].split("/")
56
57
  end
57
58
 
@@ -151,13 +152,25 @@ module Kitchen
151
152
 
152
153
  def run_package_in_background
153
154
  if config[:use_screen]
154
- "sudo screen -mdS \"#{clean_package_name}\" hab-sup start #{package_ident} #{supervisor_options}"
155
+ "sudo screen -mdS \"#{clean_package_name}\" hab start #{package_ident} #{supervisor_options}"
155
156
  else
156
157
  <<-RUN
157
158
  [ -f ./run.pid ] && rm -f run.pid
158
159
  [ -f ./nohup.out ] && rm -f nohup.out
159
- nohup sudo hab-sup start #{package_ident} #{supervisor_options} & echo $! > run.pid
160
- sleep 5
160
+ nohup sudo hab sup run & echo $! > run.pid
161
+
162
+ until hab svc status
163
+ do
164
+ sleep 1
165
+ done
166
+
167
+ sudo hab start #{package_ident} #{supervisor_options}
168
+
169
+ until hab svc status | grep #{package_ident}
170
+ do
171
+ sleep 1
172
+ done
173
+
161
174
  [ -f ./nohup.out ] && cat nohup.out || (echo "Failed to start the supervisor." && exit 1)
162
175
  RUN
163
176
  end
@@ -304,6 +317,7 @@ module Kitchen
304
317
  options += " --group #{config[:hab_sup_group]}" unless config[:hab_sup_group].nil?
305
318
  options += " --topology #{config[:service_topology]}" unless config[:service_topology].nil?
306
319
  options += " --strategy #{config[:service_update_strategy]}" unless config[:service_update_strategy].nil?
320
+ options += " --channel #{config[:channel]}" unless config[:channel].nil?
307
321
 
308
322
  options
309
323
  end
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Habitat
3
- VERSION = "0.6.1".freeze
3
+ VERSION = "0.7.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-habitat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project: "[none]"
136
- rubygems_version: 2.6.10
136
+ rubygems_version: 2.6.11
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Habitat provisioner for test-kitchen