@@ -19,14 +19,7 @@ println() {
1919 printf " ${FORMAT} \n" $*
2020}
2121
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 () {
3023 println " Using the following artifacts..."
3124 println " Bullet Examples: ${BULLET_EXAMPLES_VERSION} "
3225 println " Bullet Web Service: ${BULLET_WS_VERSION} "
@@ -38,6 +31,15 @@ export_vars() {
3831 println " Done!"
3932}
4033
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+
4143setup () {
4244 println " Setting up directories..."
4345 mkdir -p $BULLET_HOME /backend/storm
@@ -187,8 +189,6 @@ launch_bullet_ui() {
187189cleanup () {
188190 set +eo pipefail
189191
190- storm kill bullet && sleep 30
191-
192192 ps aux | grep " [e]xpress-server.js" | awk ' {print $2}' | xargs kill
193193
194194 ps aux | grep " [e]xample_context.properties" | awk ' {print $2}' | xargs kill
@@ -201,20 +201,21 @@ cleanup() {
201201}
202202
203203teardown () {
204- println " Killing all Bullet components. This may take a while if the topology is up. .."
204+ println " Killing all Bullet components..."
205205 cleanup & > /dev/null
206206 println " Done!"
207207}
208208
209209unset_all () {
210- unset -f println export_vars setup install_bullet_examples \
210+ unset -f print_versions println export_vars setup install_bullet_examples \
211211 install_storm launch_storm launch_bullet_storm \
212212 install_jetty launch_bullet_web_service \
213213 install_node launch_bullet_ui \
214214 cleanup teardown unset_all launch
215215}
216216
217217launch () {
218+ print_versions
218219 export_vars
219220
220221 teardown
@@ -236,5 +237,14 @@ launch() {
236237 unset_all
237238}
238239
239- launch
240+ clean () {
241+ export_vars
242+ teardown
243+ unset_all
244+ }
240245
246+ if [ $# -eq 0]; then
247+ launch
248+ else
249+ clean
250+ fi
0 commit comments