From 6170a71830da3afa744077498dc943102e86887d Mon Sep 17 00:00:00 2001 From: Monica Riccelli Date: Mon, 3 Dec 2018 22:58:39 -0500 Subject: [PATCH] Correct argument name --- .../12213-domain-home-in-image/Dockerfile | 2 +- .../12213-domain-home-in-image/build.sh | 2 +- .../container-scripts/setEnv.sh | 25 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/Dockerfile b/OracleWebLogic/samples/12213-domain-home-in-image/Dockerfile index 58dd4411f0..2dae1b77d8 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image/Dockerfile +++ b/OracleWebLogic/samples/12213-domain-home-in-image/Dockerfile @@ -24,7 +24,7 @@ FROM oracle/weblogic:12.2.1.3-developer MAINTAINER Monica Riccelli ARG CUSTOM_DOMAIN_NAME="${CUSTOM_DOMAIN_NAME:-domain1}" -ARG CUSTOM_ADMIN_PORT="${CUSTOM__ADMIN_PORT:-7001}" +ARG CUSTOM_ADMIN_PORT="${CUSTOM_ADMIN_PORT:-7001}" ARG CUSTOM_MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT:-8001}" ARG CUSTOM_DEBUG_PORT="${CUSTOM_DEBUG_PORT:-8453}" ARG CUSTOM_ADMIN_NAME="${CUSTOM_ADMIN_NAME:-admin-server}" diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/build.sh b/OracleWebLogic/samples/12213-domain-home-in-image/build.sh index ea9442963e..d3c6b084e0 100755 --- a/OracleWebLogic/samples/12213-domain-home-in-image/build.sh +++ b/OracleWebLogic/samples/12213-domain-home-in-image/build.sh @@ -4,6 +4,6 @@ # #Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. # -. container-scripts/setEnv.sh ./properties/docker_build/domain.properties +. ./container-scripts/setEnv.sh ./properties/docker_build/domain.properties docker build $BUILD_ARG -t 12213-domain-home-in-image . diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/setEnv.sh b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/setEnv.sh index b93c23e15f..1a93d5fa47 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/setEnv.sh +++ b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/setEnv.sh @@ -5,15 +5,15 @@ #Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. BUILD_ARG='' -if [ $# > 1 ]; then - PROPERTIES_FILE=$1 -fi - -if [ ! -e "${PROPERTIES_FILE}" ]; then +if [ "$#" -eq "0" ] + then echo "A properties file with variable definitions should be supplied." -fi + exit 1 + else + PROPERTIES_FILE=$1 + echo Export environment variables from the ${PROPERTIES_FILE} properties file + fi -echo Export environment variables from the ${PROPERTIES_FILE} properties file CUSTOM_DOMAIN_NAME=`awk '{print $1}' $PROPERTIES_FILE | grep ^DOMAIN_NAME= | cut -d "=" -f2` if [ -n "$CUSTOM_DOMAIN_NAME" ]; then @@ -43,11 +43,11 @@ if [ -n "$CUSTOM_ADMIN_PORT" ]; then BUILD_ARG="$BUILD_ARG --build-arg CUSTOM_ADMIN_PORT=$CUSTOM_ADMIN_PORT" fi -CUSTOM_MS_PORT=`awk '{print $1}' $PROPERTIES_FILE | grep ^MANAGED_SERVER_PORT= | cut -d "=" -f2` -if [ -n "$CUSTOM_MS_PORT" ]; then - export CUSTOM_MS_PORT=$CUSTOM_MS_PORT - echo CUSTOM_MS_PORT=$CUSTOM_MS_PORT - BUILD_ARG="$BUILD_ARG --build-arg CUSTOM_MS_PORT=$CUSTOM_MS_PORT" +CUSTOM_MANAGED_SERVER_PORT=`awk '{print $1}' $PROPERTIES_FILE | grep ^MANAGED_SERVER_PORT= | cut -d "=" -f2` +if [ -n "$CUSTOM_MANAGED_SERVER_PORT" ]; then + export CUSTOM_MANAGED_SERVER_PORT=$CUSTOM_MANAGED_SERVER_PORT + echo CUSTOM_MANAGED_SERVER_PORT=$CUSTOM_MANAGED_SERVER_PORT + BUILD_ARG="$BUILD_ARG --build-arg CUSTOM_MANAGED_SERVER_PORT=$CUSTOM_MANAGED_SERVER_PORT" fi CUSTOM_DEBUG_PORT=`awk '{print $1}' $PROPERTIES_FILE | grep ^DEBUG_PORT= | cut -d "=" -f2` @@ -57,4 +57,5 @@ if [ -n "$CUSTOM_DEBUG_PORT" ]; then BUILD_ARG="$BUILD_ARG --build-arg CUSTOM_DEBUG_PORT=$CUSTOM_DEBUG_PORT" fi +export BUILD_ARG=$BUILD_ARG echo BUILD_ARG=$BUILD_ARG