kitchen-habitat 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/lib/kitchen-habitat/version.rb +1 -1
- data/lib/kitchen/provisioner/habitat.rb +13 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6694587068b88af9d3ed639a257adcfd517f875
|
4
|
+
data.tar.gz: b91653665f443ee506cc0b54126c3f4d3ec5aba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dc477c2e3f31d2390606aa4fa51492f3f713ab9aeed36e14066543c71bf3484eb99e8c3802f874e111e9080892e9655a49ec1c362bc68e0643748e09ddcdc9f
|
7
|
+
data.tar.gz: a83287c2bdc77cb43991062d6424e0598a9d9a92f1d2499fbdd0580efb4885bb16c76cf59e75f4ca3053b058349a453405938dace84a2237837099be9ad9557c
|
data/README.md
CHANGED
@@ -42,6 +42,9 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
|
|
42
42
|
* `hab_sup_listen_gossip`
|
43
43
|
* Port for the supervisor's gossip communication
|
44
44
|
* Defaults to `nil`
|
45
|
+
* `hab_sup_group`
|
46
|
+
* Service group for the supervisor to belong do.
|
47
|
+
* Default is `default`
|
45
48
|
|
46
49
|
### Package Settings
|
47
50
|
|
@@ -66,9 +69,15 @@ You'll need the test-kitchen & kitchen-habitat gems installed in your system, al
|
|
66
69
|
* `package_timestamp`
|
67
70
|
* Package timestamp of the package to be run.
|
68
71
|
* Defaults to `nil` or if `artifact_name` is supplied, the `package_timestamp` will be parsed from the filename of the hart file.
|
72
|
+
* `service_topology`
|
73
|
+
* The topology for the service to run in. Valid values are `nil`, `standalone`, `leader`
|
74
|
+
* Defaults to `nil` which is `standalone`
|
75
|
+
* `service_update_strategy`
|
76
|
+
* Describes how package updates are to be applied. Valid values are `nil`, `at-once`, `rolling`.
|
77
|
+
* Default is `nil`, which does not check for package updates.
|
69
78
|
* `config_directory`
|
70
79
|
* Directory containing a user.toml or/and a default.toml, hooks, and configuration files to be passed to the service under test.
|
71
|
-
*
|
80
|
+
* Defaults to `nil`
|
72
81
|
* `override_package_config`
|
73
82
|
* 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.)
|
74
83
|
* `user_toml_name`
|
@@ -28,6 +28,7 @@ module Kitchen
|
|
28
28
|
default_config :hab_sup_listen_gossip, nil
|
29
29
|
default_config :hab_sup_peer, []
|
30
30
|
default_config :hab_sup_bind, []
|
31
|
+
default_config :hab_sup_group, nil
|
31
32
|
|
32
33
|
# hab-sup service options
|
33
34
|
default_config :artifact_name, nil
|
@@ -37,6 +38,9 @@ module Kitchen
|
|
37
38
|
end
|
38
39
|
default_config :package_version, nil
|
39
40
|
default_config :package_timestamp, nil
|
41
|
+
default_config :service_topology, nil
|
42
|
+
default_config :service_update_strategy, nil
|
43
|
+
|
40
44
|
|
41
45
|
# local stuffs to copy
|
42
46
|
default_config :results_directory, nil
|
@@ -145,7 +149,7 @@ module Kitchen
|
|
145
149
|
else
|
146
150
|
<<-RUN
|
147
151
|
[ -f ./run.pid ] && rm -f run.pid
|
148
|
-
[ -f ./nohup.out ] && rm -f nohup.out
|
152
|
+
[ -f ./nohup.out ] && rm -f nohup.out
|
149
153
|
nohup sudo hab-sup start #{package_ident} #{supervisor_options} & echo $! > run.pid
|
150
154
|
sleep 5
|
151
155
|
[ -f ./nohup.out ] && cat nohup.out || (echo "Failed to start the supervisor." && exit 1)
|
@@ -246,12 +250,16 @@ module Kitchen
|
|
246
250
|
end
|
247
251
|
|
248
252
|
def supervisor_options
|
249
|
-
options = "
|
250
|
-
"
|
251
|
-
"
|
252
|
-
options.
|
253
|
+
options = ""
|
254
|
+
options += " --listen-gossip #{config[:hab_sup_listen_gossip]}" unless config[:hab_sup_listen_gossip].nil?
|
255
|
+
options += " --listen-http #{config[:hab_sup_listen_http]}" unless config[:hab_sup_listen_http].nil?}
|
256
|
+
options += " --config-from #{File.join(config[:root_path], 'config/')}" if config[:override_package_config]}
|
253
257
|
options += config[:hab_sup_bind].map { |b| " --bind #{b}" }.join(" ") if config[:hab_sup_bind].any?
|
254
258
|
options += config[:hab_sup_peer].map { |p| " --peer #{p}" }.join(" ") if config[:hab_sup_peer].any?
|
259
|
+
options += " --group #{config[:hab_sup_group]}" unless config[:hab_sup_group].nil?
|
260
|
+
options += " --topology #{config[:service_topology]}" unless config[:service_topology].nil?
|
261
|
+
options += " --strategy #{config[:service_update_strategy]}" unless config[:service_update_strategy].nil?
|
262
|
+
|
255
263
|
options
|
256
264
|
end
|
257
265
|
end
|