forked from IHTSDO/release-validation-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-api-local.sh
executable file
·46 lines (40 loc) · 1.16 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=8080
while getopts ":dsp:" opt
do
case $opt in
d)
debugMode=true
echo "Option set to start API in debug mode."
debugFlags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001 -Djava.compiler=NONE"
;;
s)
skipMode=true
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 [ -z "${skipMode}" ]
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) -jar api/target/validation-api.jar -DrvfConfigLocation=${configLocation} -httpPort=${apiPort}