@@ -19,14 +19,7 @@ println() {
19
19
printf " ${FORMAT} \n" $*
20
20
}
21
21
22
- export_vars () {
23
- local PWD=" $( pwd) "
24
-
25
- println " Exporting some variables..."
26
- export BULLET_HOME=" ${PWD} /bullet-quickstart"
27
- export BULLET_EXAMPLES=$BULLET_HOME /bullet-examples
28
- println " Done!"
29
-
22
+ print_versions () {
30
23
println " Using the following artifacts..."
31
24
println " Bullet Examples: ${BULLET_EXAMPLES_VERSION} "
32
25
println " Bullet Web Service: ${BULLET_WS_VERSION} "
@@ -38,6 +31,15 @@ export_vars() {
38
31
println " Done!"
39
32
}
40
33
34
+ export_vars () {
35
+ local PWD=" $( pwd) "
36
+
37
+ println " Exporting some variables..."
38
+ export BULLET_HOME=" ${PWD} /bullet-quickstart"
39
+ export BULLET_EXAMPLES=$BULLET_HOME /bullet-examples
40
+ println " Done!"
41
+ }
42
+
41
43
setup () {
42
44
println " Setting up directories..."
43
45
mkdir -p $BULLET_HOME /backend/storm
@@ -187,8 +189,6 @@ launch_bullet_ui() {
187
189
cleanup () {
188
190
set +eo pipefail
189
191
190
- storm kill bullet && sleep 30
191
-
192
192
ps aux | grep " [e]xpress-server.js" | awk ' {print $2}' | xargs kill
193
193
194
194
ps aux | grep " [e]xample_context.properties" | awk ' {print $2}' | xargs kill
@@ -201,20 +201,21 @@ cleanup() {
201
201
}
202
202
203
203
teardown () {
204
- println " Killing all Bullet components. This may take a while if the topology is up. .."
204
+ println " Killing all Bullet components..."
205
205
cleanup & > /dev/null
206
206
println " Done!"
207
207
}
208
208
209
209
unset_all () {
210
- unset -f println export_vars setup install_bullet_examples \
210
+ unset -f print_versions println export_vars setup install_bullet_examples \
211
211
install_storm launch_storm launch_bullet_storm \
212
212
install_jetty launch_bullet_web_service \
213
213
install_node launch_bullet_ui \
214
214
cleanup teardown unset_all launch
215
215
}
216
216
217
217
launch () {
218
+ print_versions
218
219
export_vars
219
220
220
221
teardown
@@ -236,5 +237,14 @@ launch() {
236
237
unset_all
237
238
}
238
239
239
- launch
240
+ clean () {
241
+ export_vars
242
+ teardown
243
+ unset_all
244
+ }
240
245
246
+ if [ $# -eq 0]; then
247
+ launch
248
+ else
249
+ clean
250
+ fi
0 commit comments