Repository navigation
Expand file tree
/
Copy pathstart
More file actions
executable file
·66 lines (63 loc) · 1.88 KB
/
Copy pathstart
File metadata and controls
executable file
·66 lines (63 loc) · 1.88 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
APP_ENTRY=${app.entry}
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BASE=$DIR/.
CP=$BASE/classes:$BASE/lib/*
CMD=$0
DEBUG=0
DEBUG_PORT=5005
PROFILE=
SYS_PROP=
HELP=0
export act_env_gh636_conf=bar
# As long as there is at least one more argument, keep looping
while [[ $# -gt 0 ]]; do
key="$1"
case "$key" in
# enable remote debugging with -d or --debug
-d|--debug)
DEBUG=1
;;
# specify remote debug port with --debug-port=<port>
--debug-port)
shift # past the key and to the value
DEBUG_PORT="$1"
;;
# specify the profile with -p or --profile
-p|--profile)
shift # past the key and to the value
PROFILE="$1"
;;
# specify any java system property
-D*)
SYS_PROP="$SYSPROP $1"
;;
# help ?
-h|--help)
echo $CMD start the app
echo ''
echo ' -d --debug: enable remote debugging'
echo ' --debug-port <port>: specify debug port (if not specified then debug port is 5005)'
echo ' -p --profile: specify the profile to start the app'
echo ' -D*: specify any JVM system properties'
echo ' -h --help: display this help message'
HELP=1
;;
*)
# Do whatever you want with extra options
echo "Unknown option '$key'"
;;
esac
# Shift after checking all the cases to get the next option
shift
done
if [[ HELP -gt 0 ]]; then
# don't run in help mode
echo ''
else
if [[ DEBUG -gt 0 ]]; then
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$DEBUG_PORT $JAVA_OPTS -Dapp.mode=prod -Dprofile=$PROFILE $SYS_PROP -cp "$CP" $APP_ENTRY
else
java $JAVA_OPTS -Dapp.mode=prod -Dprofile=$PROFILE $SYS_PROP -cp "$CP" $APP_ENTRY
fi
fi