-
Notifications
You must be signed in to change notification settings - Fork 2
/
local_run.sh
executable file
·31 lines (26 loc) · 1.07 KB
/
local_run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
SONGS_SAMPLE_URL=https://labrosa.ee.columbia.edu/millionsong/sites/default/files/AdditionalFiles/tracks_per_year.txt
MOVIES_SAMPLE_URL=http://files.grouplens.org/datasets/movielens/ml-latest-small.zip
WORKING_DIR=.run
OUTPUT_PATH=$WORKING_DIR/out
SAMPLES_PATH=$WORKING_DIR/samples
SONGS_SAMPLE_PATH=$SAMPLES_PATH/tracks_per_year.txt
MOVIES_SAMPLE_PATH=$SAMPLES_PATH/ml-latest-small.zip
APP_NAME=spring-kafka
LOADER_PATH=config \
EXECUTABLE_JAR=$(ls target/*.jar |grep $APP_NAME) \
case "$1" in
debug)
DEBUG=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
;;
*)
DEBUG=
esac
if [ ! -f $SONGS_SAMPLE_PATH ]; then
wget $SONGS_SAMPLE_URL -P $SAMPLES_PATH
fi
if [ ! -f $MOVIES_SAMPLE_PATH ]; then
wget $MOVIES_SAMPLE_URL -P $SAMPLES_PATH
fi
unzip -o $MOVIES_SAMPLE_PATH -d $SAMPLES_PATH
java $DEBUG -Dserver.port=8080 -Dloader.path=$LOADER_PATH -Dsongs.sample.path=$SONGS_SAMPLE_PATH -Dmovies.sample.path=$SAMPLES_PATH/ml-latest-small -Dconsumers.output.path=$OUTPUT_PATH -DAPP_NAME=$APP_NAME -jar $EXECUTABLE_JAR