Skip to content

Commit b24daed

Browse files
committed
Fix pre-18.2 support
1 parent e9f3206 commit b24daed

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,6 @@ $RECYCLE.BIN/
8686
*.rpm
8787
tmp
8888
dockerfiles
89-
oradata
89+
oradata
90+
^sample.env
91+
*.env

02-build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV_FILE=${1:-.env}
44

55
. $ENV_FILE
66

7-
BASE_DIR=$(readlink -f $0 | xargs dirname)
7+
BASE_DIR=$(readlink -f -- "$0" | xargs dirname)
88
DB_VERSION=${DB_VERSION:-18.4.0}
99
DB_EDITION=${DB_EDITION:-XE}
1010

@@ -24,4 +24,4 @@ echo "##### Building Docker Image for Oracle Database ${DB_VERSION} {$DB_EDITION
2424
cd dockerfiles && . buildDockerImage.sh -v ${DB_VERSION} ${DB_EDITION_FLAG}
2525

2626
cd $BASE_DIR
27-
echo "##### Done #####"
27+
echo "##### Done #####"

sample.env

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ ORACLE_PDB=XEPDB1
33
ORACLE_PWD=Oracle18
44
APEX_ADMIN_EMAIL=myemail@domain.com
55
APEX_ADMIN_PWD=Oracle__18
6+
APEX_PUBLIC_USER_PWD=Oracle18_1
7+
APEX_LISTENER_PWD=Oracle18_2
8+
APEX_REST_PUBLIC_USER_PWD=Oracle18_3
9+
ORDS_PUBLIC_USER_PWD=Oracle18_4
610
INSTALL_FILE_APEX=apex_18.2.zip
711
INSTALL_FILE_ORDS=ords-18.4.0.354.1002.zip
812
DOCKER_ORDS_PORT=50080
913
DOCKER_EM_PORT=55500
1014
DOCKER_DB_PORT=51521
1115
DB_VERSION=18.4.0
12-
DB_EDITION=XE
16+
DB_EDITION=XE

scripts/setup/01-install.sh

+11
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ unzip -q $FILES_DIR/$INSTALL_FILE_APEX -d $ORACLE_BASE/product
1515
unzip -q $FILES_DIR/$INSTALL_FILE_ORDS -d $ORDS_HOME
1616
chown -R oracle:oinstall $APEX_HOME $ORDS_HOME
1717

18+
# Set apex_rest_config prefix if required
19+
APEX_VERSION=$(echo $INSTALL_FILE_APEX | sed -r 's/^apex_(.+)\.zip$/\1/')
20+
case "$APEX_VERSION" in
21+
4.*|5.*|18.1)
22+
# DO NOT add prefix for apex_rest_config
23+
;;
24+
*)
25+
export PREFIX=@
26+
;;
27+
esac
28+
1829
# Install APEX
1930
echo "##### Installing APEX #####"
2031
runuser oracle -m -s /bin/bash -c ". $SCRIPT_DIR/package/installApex.sh"

scripts/setup/package/installApex.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ sqlplus / as sysdba << EOF
1717
@apexins.sql SYSAUX SYSAUX TEMP /i/
1818
1919
-- APEX REST configuration
20-
@apex_rest_config_core.sql @ ${ORACLE_PWD} ${ORACLE_PWD}
20+
@apex_rest_config_core.sql $PREFIX "${APEX_LISTENER_PWD:-$ORACLE_PWD}" "${APEX_REST_PUBLIC_USER_PWD:-$ORACLE_PWD}"
2121
2222
-- Required for ORDS install
23-
alter user apex_public_user identified by ${ORACLE_PWD} account unlock;
23+
alter user apex_public_user identified by "${APEX_PUBLIC_USER_PWD:-$ORACLE_PWD}" account unlock;
2424
2525
-- Network ACL
2626
prompt Setup Network ACL

scripts/setup/package/installOrds.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cd $ORDS_HOME
1515

1616
cat << EOF > $ORDS_HOME/params/custom_params.properties
1717
db.hostname=localhost
18-
db.password=${ORACLE_PWD}
18+
db.password=${APEX_PUBLIC_USER_PWD:-$ORACLE_PWD}
1919
db.port=1521
2020
db.servicename=${ORACLE_PDB:-XEPDB1}
2121
db.username=APEX_PUBLIC_USER
@@ -24,9 +24,9 @@ rest.services.apex.add=true
2424
rest.services.ords.add=true
2525
schema.tablespace.default=SYSAUX
2626
schema.tablespace.temp=TEMP
27-
user.apex.listener.password=${ORACLE_PWD}
28-
user.apex.restpublic.password=${ORACLE_PWD}
29-
user.public.password=${ORACLE_PWD}
27+
user.apex.listener.password=${APEX_LISTENER_PWD:-$ORACLE_PWD}
28+
user.apex.restpublic.password=${APEX_REST_PUBLIC_USER_PWD:-$ORACLE_PWD}
29+
user.public.password=${ORDS_PUBLIC_USER_PWD:-$ORACLE_PWD}
3030
user.tablespace.default=SYSAUX
3131
user.tablespace.temp=TEMP
3232
sys.user=sys

0 commit comments

Comments
 (0)