Skip to content

Commit

Permalink
Updating contrib/oracle config and grab-instantclient.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Shaw committed Aug 13, 2019
1 parent 3982285 commit 6dd6050
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions contrib/oracle/docker-config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME=oracle
IMAGE=sath89/oracle-12c
IMAGE=oracle/database:19.3.0-ee
PUBLISH=1521:1521
ENV=DBCA_TOTAL_MEMORY=1024
VOLUME=/media/src/opt/oracle:/u01/app/oracle
ENV="ORACLE_SID=orasid ORACLE_PDB=db1 ORACLE_PWD=P4ssw0rd"
VOLUME=/media/src/opt/oracle:/opt/oracle/oradata
44 changes: 22 additions & 22 deletions contrib/oracle/grab-instantclient.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
DEST=${1:-/opt/oracle}

VERSION=19.3.0.0.0dbru
DVER=$(awk -F. '{print $1 "_" $2}' <<< "$VERSION")

BASE=https://media.githubusercontent.com/media/epoweripione/oracle-instantclient-18/master

BASIC=$BASE/instantclient-basic-linux.x64-$VERSION.zip
SDK=$BASE/instantclient-sdk-linux.x64-$VERSION.zip

if [ ! -w $DEST ]; then
echo "ERROR: not able to write to $DEST"
exit 1
fi

echo "DEST: $DEST"
echo "BASIC: $BASIC"
echo "SDK: $SDK"
# build list of archives to retrieve
declare -a ARCHIVES
for i in basic sdk sqlplus; do
ARCHIVES+=("$BASE/instantclient-$i-linux.x64-$VERSION.zip")
done

grab() {
echo -n "RETRIEVING: $1 -> $2 "
Expand All @@ -36,27 +28,35 @@ cache() {
fi
}

set -e

echo "DEST: $DEST"
if [ ! -w $DEST ]; then
echo "$DEST is not writable!"
exit 1
fi
if [ ! -e "$DEST" ]; then
echo "$DEST does not exist"
echo "$DEST does not exist!"
exit 1
fi

set -e

# retrieve
cache $DEST $BASIC
cache $DEST $SDK
# retrieve archives
for i in ${ARCHIVES[@]}; do
cache $DEST $i
done

# remove existing directory, if any
DVER=$(awk -F. '{print $1 "_" $2}' <<< "$VERSION")
if [ -e $DEST/instantclient_$DVER ]; then
echo "REMOVING: $DEST/instantclient_$DVER"
echo "REMOVING: $DEST/instantclient_$DVER"
rm -rf $DEST/instantclient_$DVER
fi

# extract
pushd $DEST &> /dev/null
unzip -qq $(basename $BASIC)
unzip -qq $(basename $SDK)
for i in ${ARCHIVES[@]}; do
unzip -qq $(basename $i)
done
popd &> /dev/null

# write pkg-config file
Expand Down

0 comments on commit 6dd6050

Please sign in to comment.