kitchen-habitat 0.2.1 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/provisioner/habitat.rb +18 -4
- data/lib/kitchen-habitat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f5bd09f9be9941cb4fbb5854d6e190133ac755
|
4
|
+
data.tar.gz: d282775cb109380519f3163f053f3586afa4db62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5697def2efc706d739ae06182d8b430e623405a5e0e488817a8c8f076ea84075d81e52d88606ad5ff6ecf64e7e18205067bfac90556b2502081293ef8aac76b0
|
7
|
+
data.tar.gz: 70a4508a072c3f752082be170ec8d8d1db45c4357ed51edefc99bbcfe6cba0d2e1511190e5c0ee34f6db3e15a192699bf4cf4c667945220daca9c741aa4a86cc
|
@@ -105,12 +105,11 @@ module Kitchen
|
|
105
105
|
|
106
106
|
def run_command
|
107
107
|
run = <<-RUN
|
108
|
-
#{clean_up_screen_sessions}
|
109
108
|
#{export_hab_origin}
|
109
|
+
#{clean_up_screen_sessions}
|
110
|
+
#{clean_up_previous_supervisor}
|
110
111
|
echo "Running #{package_ident}."
|
111
|
-
|
112
112
|
#{run_package_in_background}
|
113
|
-
sleep 5
|
114
113
|
RUN
|
115
114
|
|
116
115
|
wrap_shell_code run
|
@@ -131,11 +130,26 @@ module Kitchen
|
|
131
130
|
CLEAN
|
132
131
|
end
|
133
132
|
|
133
|
+
def clean_up_previous_supervisor
|
134
|
+
return if config[:use_screen]
|
135
|
+
<<-EOH
|
136
|
+
[ -f ./run.pid ] && echo "Removing previous supervisor. "
|
137
|
+
[ -f ./run.pid ] && sudo kill $(cat run.pid)
|
138
|
+
[ -f ./run.pid ] && sleep 5
|
139
|
+
EOH
|
140
|
+
end
|
141
|
+
|
134
142
|
def run_package_in_background
|
135
143
|
if config[:use_screen]
|
136
144
|
"sudo screen -mdS \"#{clean_package_name}\" hab-sup start #{package_ident} #{supervisor_options}"
|
137
145
|
else
|
138
|
-
|
146
|
+
<<-RUN
|
147
|
+
[ -f ./run.pid ] && rm -f run.pid
|
148
|
+
[ -f ./nohup.out ] && rm -f nohup.out
|
149
|
+
nohup sudo hab-sup start #{package_ident} #{supervisor_options} & echo $! > run.pid
|
150
|
+
sleep 5
|
151
|
+
[ -f ./nohup.out ] && cat nohup.out || (echo "Failed to start the supervisor." && exit 1)
|
152
|
+
RUN
|
139
153
|
end
|
140
154
|
end
|
141
155
|
|
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.2.
|
4
|
+
version: 0.2.4
|
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-
|
11
|
+
date: 2017-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|