-
Notifications
You must be signed in to change notification settings - Fork 14
/
start-api-local.sh
executable file
·44 lines (40 loc) · 1.19 KB
/
start-api-local.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
#!/bin/bash
set -e
#example useage ./start-api-local.sh -d -p 8081
apiPort=8081
buildApp=true
debugFlags=""
while getopts ":dsp:" opt
do
case $opt in
d)
debugFlags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001 -Djava.compiler=NONE"
echo "Option set to start API in debug mode."
;;
s)
buildApp=false
echo "Option set to skip build."
;;
p)
apiPort=$OPTARG
echo "Option set run API on port ${apiPort}"
;;
help|\?)
echo -e "Usage: [-d] [-s] [-p <port>]"
echo -e "\t d - debug. Starts the API in debug mode, which an IDE can attach to on port 8001"
echo -e "\t p <port> - Starts the API on a specific port (default 8080)"
echo -e "\t s - skip. Skips the build"
exit 0
;;
esac
done
if $buildApp; then
echo 'Building RVF API webapp..'
sleep 1
mvn clean install -Dapple.awt.UIElement='true' -DrvfConfigLocation=/tmp
echo
fi
configLocation="$(pwd)/config"
echo "Starting RVF API webapp on port ${apiPort} with config directory ${configLocation}"
echo
java -Xmx4g ${debugFlags} -DENV_NAME=$(whoami) -DrvfConfigLocation=${configLocation} -jar api/target/dependency/webapp-runner.jar api/target/api.war --path /api --port ${apiPort}