Skip to content

Commit 9d7bdf7

Browse files
committed
Adding a clean step
1 parent 86c8462 commit 9d7bdf7

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

docs/quick-start.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ By the following the steps in this section, you will:
1919
Don't want to follow all these Steps? Make sure you have your prerequisites installed and you can just run:
2020

2121
```bash
22+
export BULLET_HOME=$(pwd)/bullet-quickstart
2223
curl -sLo- https://raw.githubusercontent.com/yahoo/bullet-docs/v0.1.2/examples/install-all.sh | bash
2324
```
2425

@@ -224,12 +225,15 @@ To cleanup all the components we bought up:
224225

225226
| | |
226227
| -------------- | ----------------------------------------------------------------------------------- |
227-
| Storm Topology | ```storm kill bullet``` |
228228
| UI | ```ps aux | grep [e]xpress-server.js | awk '{print $2}' | xargs kill``` |
229229
| Web Service | ```ps aux | grep [e]xample_context.properties | awk '{print $2}' | xargs kill``` |
230230
| Storm | ```ps aux | grep [a]pache-storm-1.0.3 | awk '{print $2}' | xargs kill``` |
231+
| File System | ```rm -rf $BULLET_HOME /tmp/dev-storm-zookeeper /tmp/jetty-*``` |
231232

232-
You can also ```rm -rf $BULLET_HOME /tmp/dev-storm-zookeeper /tmp/jetty-*``` to delete *everything* that we did so far.
233+
If you were following the [Quicker Start](#quicker-start) script, you can also do
234+
```bash
235+
curl -sLo- https://raw.githubusercontent.com/yahoo/bullet-docs/v0.1.2/examples/install-all.sh | bash
236+
```
233237

234238
## What did we do?
235239

examples/install-all.sh

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
4143
setup() {
4244
println "Setting up directories..."
4345
mkdir -p $BULLET_HOME/backend/storm
@@ -187,8 +189,6 @@ launch_bullet_ui() {
187189
cleanup() {
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

203203
teardown() {
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

209209
unset_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

217217
launch() {
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

Comments
 (0)