Skip to content

Commit cfb939f

Browse files
committed
shellcheck fix for storage container
1 parent 9c13ff6 commit cfb939f

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

OracleDatabase/RAC/OracleRACStorageServer/containerfiles/buildContainerImage.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Builds a Docker Image for Oracle Database.
1313
1414
Parameters:
1515
-v: version to build
16-
Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done)
1716
Choose "latest" version for podman host machines
1817
Choose "ol7" version for docker host machines
1918
-o: passes on Docker build option
@@ -34,7 +33,7 @@ EOF
3433

3534
# Parameters
3635
VERSION="latest"
37-
SKIPMD5=0
36+
export SKIPMD5=0
3837
DOCKEROPS=""
3938

4039
while getopts "hiv:o:" optname; do
@@ -70,7 +69,7 @@ else
7069
exit 1
7170
fi
7271
# Go into version folder
73-
cd $VERSION
72+
cd "$VERSION" || exit
7473

7574
echo "=========================="
7675
echo "DOCKER info:"
@@ -79,22 +78,23 @@ echo "=========================="
7978

8079
# Proxy settings
8180
PROXY_SETTINGS=""
81+
# shellcheck disable=SC2154
8282
if [ "${http_proxy}" != "" ]; then
8383
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}"
8484
fi
85-
85+
# shellcheck disable=SC2154
8686
if [ "${https_proxy}" != "" ]; then
8787
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}"
8888
fi
89-
89+
# shellcheck disable=SC2154
9090
if [ "${ftp_proxy}" != "" ]; then
9191
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}"
9292
fi
93-
93+
# shellcheck disable=SC2154
9494
if [ "${no_proxy}" != "" ]; then
9595
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}"
9696
fi
97-
97+
# shellcheck disable=SC2154
9898
if [ "$PROXY_SETTINGS" != "" ]; then
9999
echo "Proxy settings were found and will be used during the build."
100100
fi
@@ -106,15 +106,17 @@ echo "Building image '$IMAGE_NAME' ..."
106106

107107
# BUILD THE IMAGE (replace all environment variables)
108108
BUILD_START=$(date '+%s')
109+
# shellcheck disable=SC2086
109110
$CONTAINER_BUILD_TOOL build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Containerfile . || {
110111
echo "There was an error building the image."
111112
exit 1
112113
}
113114
BUILD_END=$(date '+%s')
114-
BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START`
115+
# shellcheck disable=SC2154,SC2003
116+
BUILD_ELAPSED=$((BUILD_END - BUILD_START))
115117

116118
echo ""
117-
119+
# shellcheck disable=SC2181,SC2320
118120
if [ $? -eq 0 ]; then
119121
cat << EOF
120122
Oracle RAC Storage Server Container Image version $VERSION is ready to be extended:
@@ -127,5 +129,4 @@ EOF
127129

128130
else
129131
echo "Oracle RAC Storage Server Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation."
130-
fi
131-
132+
fi

0 commit comments

Comments
 (0)