-
Notifications
You must be signed in to change notification settings - Fork 6
/
run.sh
executable file
·55 lines (45 loc) · 1.17 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
ARGS=$(cat ARGS.txt)
if [ -e /opt/protostuffdb/bin/hprotostuffdb ]; then
BIN=/opt/protostuffdb/bin/hprotostuffdb
ARGS="$ARGS -Dprotostuffdb.with_backup=true"
elif [ -e /opt/protostuffdb/bin/protostuffdb ]; then
BIN=/opt/protostuffdb/bin/protostuffdb
elif [ -e target/protostuffdb ]; then
BIN=./target/protostuffdb
else
echo 'The target/protostuffdb binary must exist' && exit 1
fi
DATA_DIR=target/data/main
JAR=bookmarks-all/target/bookmarks-all-jarjar.jar
PORT=$(cat PORT.txt)
jarjar() {
cd bookmarks-all
rm -f target/*.jar
mvn -o -Pjwd -Djwd=compile -Dmaven.javadoc.skip=true compile
cd - > /dev/null
}
case "$1" in
0)
# recompile and skip run
rm -f $JAR
jarjar
exit 0
;;
1)
# recompile
rm -f $JAR
;;
*)
# regenerate and recompile module
[ "$1" != "" ] && [ -e "modules/$1" ] && \
./modules/codegen.sh $1 && \
cd modules/$1 && \
mvn -o -Dmaven.javadoc.skip=true install && \
cd - > /dev/null && \
rm -f $JAR
;;
esac
[ -e $JAR ] || jarjar
mkdir -p $DATA_DIR
$BIN $PORT bookmarks-ts/g/user/UserServices.json $ARGS -Djava.class.path=$JAR bookmarks.all.Main