This repository has been archived by the owner on Sep 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·64 lines (51 loc) · 1.76 KB
/
entrypoint.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
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
OPTS=`getopt -o h --long help,db-host:,db-port:,db-service-name:,db-sid:,apex-pu-pass:,apex-listener-pass:,apex-listener-pass:,apex-rest-pu-pass:,db-sys-pass: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
#echo "$OPTS"
eval set -- "$OPTS"
while true; do
case "$1" in
--db-host ) DB_HOSTNAME="$2"; shift; shift ;;
--db-port ) DB_PORT="$2"; shift; shift ;;
--db-service-name ) DB_SERVICE_NAME="$2"; shift; shift ;;
--db-sid ) DB_SID="$2"; shift; shift ;;
--db-sys-pass ) DB_SYS_PASSWORD="$2"; shift; shift ;;
--apex-pu-pass ) APEX_PUBLIC_USER_PASSWORD="$2"; shift; shift ;;
--apex-listener-pass ) APEX_LISTENER_PASSWORD="$2"; shift; shift ;;
--apex-rest-pu-pass ) APEX_REST_PUBLIC_USER_PASSWORD="$2"; shift; shift ;;
-- ) shift ; break ;;
* ) break ;;
esac
done
if [ ! -f ./ords.lock ]; then
if [ -d ./ords-current ]; then
echo "Removing old ords directory"
rm -r ./ords-current
fi
unzip ords.current.zip -d ords-current
cat <<EOF > ./ords-current/params/ords_params.properties
db.hostname=$DB_HOSTNAME
db.port=$DB_PORT
db.servicename=$DB_SERVICE_NAME
db.sid=$DB_SID
db.password=$APEX_PUBLIC_USER_PASSWORD
db.username=APEX_PUBLIC_USER
migrate.apex.rest=false
plsql.gateway.add=true
rest.services.apex.add=true
rest.services.ords.add=true
user.apex.listener.password=$APEX_LISTENER_PASSWORD
user.apex.restpublic.password=$APEX_REST_PUBLIC_USER_PASSWORD
user.public.password=$APEX_PUBLIC_USER_PASSWORD
sys.user=SYS
sys.password=$DB_SYS_PASSWORD
standalone.mode=false
EOF
java -jar ./ords-current/ords.war configdir ./conf/ords
java -jar ./ords-current/ords.war install simple
cp ./ords-current/ords.war ./webapps
touch ./ords.lock
else
echo "ords has been configured already"
fi
catalina.sh run