kitchen-habitat 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen-habitat/version.rb +1 -1
- data/lib/kitchen/provisioner/habitat.rb +29 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a1fb8ade246aa6d678e6ef4e459204465a1d905933f3497edbf5c4f42f37ce
|
4
|
+
data.tar.gz: 3d4026a94857b3f551ca4a41cea0061796a4149e6ae559187c61c5e7505bac2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15d2703d84279215547ca903670e43b8ed31551bf5a3fce94f460743a92cfb603fae10560f0b09c576fca7e571d476558e429853affe2aa09ec58d0b7ff58d0e
|
7
|
+
data.tar.gz: 136cacef506411b56e4e8b9cb97c781f8cb7b9ccee4bb741322b0ce85184e332ec5de66db52f256c4580586967d5ad8a5261a760ee11d50515a4ca9443793c25
|
@@ -17,6 +17,7 @@ module Kitchen
|
|
17
17
|
kitchen_provisioner_api_version 2
|
18
18
|
|
19
19
|
default_config :depot_url, nil
|
20
|
+
default_config :hab_version, "latest"
|
20
21
|
default_config :hab_sup_origin, "core"
|
21
22
|
default_config :hab_sup_name, "hab-sup"
|
22
23
|
default_config :hab_sup_version, nil
|
@@ -78,13 +79,17 @@ module Kitchen
|
|
78
79
|
|
79
80
|
def install_command
|
80
81
|
raise "Need to fill in some implementation here." if instance.platform == "windows"
|
82
|
+
|
83
|
+
version = " -v #{config[:hab_version]}" unless config[:hab_version].eql?("latest")
|
84
|
+
|
81
85
|
wrap_shell_code <<-BASH
|
82
86
|
#{export_hab_bldr_url}
|
83
87
|
if command -v hab >/dev/null 2>&1
|
84
88
|
then
|
85
89
|
echo "Habitat CLI already installed."
|
86
90
|
else
|
87
|
-
curl 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh'
|
91
|
+
curl -o /tmp/install.sh 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh'
|
92
|
+
sudo -E bash /tmp/install.sh#{version}
|
88
93
|
fi
|
89
94
|
BASH
|
90
95
|
end
|
@@ -154,6 +159,23 @@ module Kitchen
|
|
154
159
|
EOH
|
155
160
|
end
|
156
161
|
|
162
|
+
def sup_run_script
|
163
|
+
<<-SCRIPT
|
164
|
+
cat > /tmp/sup-run.sh <<"END"
|
165
|
+
#!/bin/bash
|
166
|
+
|
167
|
+
while true
|
168
|
+
do
|
169
|
+
COUNT=$(ps aux | grep hab | wc -l)
|
170
|
+
if [[ ${COUNT} -lt 2 ]]
|
171
|
+
then
|
172
|
+
sudo -E hab sup run #{supervisor_options} > ~/nohup.out & echo $! > /tmp/run.pid
|
173
|
+
fi
|
174
|
+
done
|
175
|
+
END
|
176
|
+
SCRIPT
|
177
|
+
end
|
178
|
+
|
157
179
|
def run_package_in_background
|
158
180
|
if config[:use_screen]
|
159
181
|
"sudo -E screen -mdS \"#{clean_package_name}\" hab start #{package_ident} #{supervisor_options}"
|
@@ -161,7 +183,12 @@ module Kitchen
|
|
161
183
|
<<-RUN
|
162
184
|
[ -f ./run.pid ] && rm -f run.pid
|
163
185
|
[ -f ./nohup.out ] && rm -f nohup.out
|
164
|
-
|
186
|
+
|
187
|
+
#{sup_run_script}
|
188
|
+
|
189
|
+
sudo -E chmod +x /tmp/sup-run.sh
|
190
|
+
|
191
|
+
nohup /tmp/sup-run.sh & > sup-run.out
|
165
192
|
|
166
193
|
until sudo -E hab svc status
|
167
194
|
do
|
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.
|
4
|
+
version: 0.11.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: 2018-
|
11
|
+
date: 2018-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|