Skip to content

Commit 158cd4a

Browse files
author
Lily He
committed
fix create-weblogic-domain.sh
1 parent c661b8d commit 158cd4a

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

kubernetes/internal/create-weblogic-domain.sh

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ function initialize {
370370
if [ ! -f ${apacheInput} ]; then
371371
validationError "The template file ${apacheInput} for generating the apache-webtier deployment was not found"
372372
fi
373-
373+
374374
voyagerOperatorInput="${scriptDir}/voyager-operator.yaml"
375375
if [ ! -f ${voyagerOperatorInput} ]; then
376376
validationError "The file ${voyagerOperatorInput} for Voyager Operator was not found"
@@ -466,6 +466,14 @@ function createYamlFiles {
466466
enabledPrefix="" # uncomment the feature
467467
disabledPrefix="# " # comment out the feature
468468

469+
# For backward compatability, default to "store/oracle/weblogic:12.2.1.3" if not defined in
470+
# create-weblogic-domain-inputs.yaml
471+
if [ -z "${weblogicImage}" ]; then
472+
weblogicImage="store/oracle/weblogic:12.2.1.3"
473+
fi
474+
# Must escape the ':' value in weblogicImage for sed to properly parse and replace
475+
weblogicImage=$(echo ${weblogicImage} | sed -e "s/\:/\\\:/g")
476+
469477
# Generate the yaml to create the persistent volume
470478
echo Generating ${domainPVOutput}
471479

@@ -503,6 +511,7 @@ function createYamlFiles {
503511
cp ${createJobInput} ${createJobOutput}
504512
sed -i -e "s:%NAMESPACE%:$namespace:g" ${createJobOutput}
505513
sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${createJobOutput}
514+
sed -i -e "s:%WEBLOGIC_IMAGE%:${weblogicImage}:g" ${createJobOutput}
506515
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${weblogicImagePullSecretName}:g" ${createJobOutput}
507516
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${weblogicImagePullSecretPrefix}:g" ${createJobOutput}
508517
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${createJobOutput}
@@ -523,6 +532,7 @@ function createYamlFiles {
523532

524533
cp ${deleteJobInput} ${deleteJobOutput}
525534
sed -i -e "s:%NAMESPACE%:$namespace:g" ${deleteJobOutput}
535+
sed -i -e "s:%WEBLOGIC_IMAGE%:${weblogicImage}:g" ${deleteJobOutput}
526536
sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${deleteJobOutput}
527537
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${weblogicImagePullSecretName}:g" ${deleteJobOutput}
528538
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${weblogicImagePullSecretPrefix}:g" ${deleteJobOutput}
@@ -550,6 +560,7 @@ function createYamlFiles {
550560
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
551561
sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${dcrOutput}
552562
sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${dcrOutput}
563+
sed -i -e "s:%WEBLOGIC_IMAGE%:${weblogicImage}:g" ${dcrOutput}
553564
sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${dcrOutput}
554565
sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${dcrOutput}
555566
sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${dcrOutput}
@@ -584,7 +595,24 @@ function createYamlFiles {
584595
if [ "${loadBalancer}" = "APACHE" ]; then
585596
# Apache file
586597
cp ${apacheInput} ${apacheOutput}
598+
587599
echo Generating ${apacheOutput}
600+
601+
if [ "${loadBalancerExposeAdminPort}" = "true" ]; then
602+
enableLoadBalancerExposeAdminPortPrefix="${enabledPrefix}"
603+
else
604+
enableLoadBalancerExposeAdminPortPrefix="${disabledPrefix}"
605+
fi
606+
607+
if [ ! -z "${loadBalancerVolumePath}" ]; then
608+
enableLoadBalancerVolumePathPrefix="${enabledPrefix}"
609+
sed -i -e "s:%LOAD_BALANCER_VOLUME_PATH%:${loadBalancerVolumePath}:g" ${apacheOutput}
610+
else
611+
enableLoadBalancerVolumePathPrefix="${disabledPrefix}"
612+
fi
613+
614+
sed -i -e "s:%ENABLE_LOAD_BALANCER_EXPOSE_ADMIN_PORT%:${enableLoadBalancerExposeAdminPortPrefix}:g" ${apacheOutput}
615+
sed -i -e "s:%ENABLE_LOAD_BALANCER_VOLUME_PATH%:${enableLoadBalancerVolumePathPrefix}:g" ${apacheOutput}
588616
sed -i -e "s:%NAMESPACE%:$namespace:g" ${apacheOutput}
589617
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${apacheOutput}
590618
sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${apacheOutput}
@@ -594,17 +622,6 @@ function createYamlFiles {
594622
sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${apacheOutput}
595623
sed -i -e "s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort:g" ${apacheOutput}
596624
sed -i -e "s:%WEB_APP_PREPATH%:$loadBalancerAppPrepath:g" ${apacheOutput}
597-
598-
if [ ! -z "${loadBalancerVolumePath}" ]; then
599-
sed -i -e "s:%LOAD_BALANCER_VOLUME_PATH%:${loadBalancerVolumePath}:g" ${apacheOutput}
600-
sed -i -e "s:# volumes:volumes:g" ${apacheOutput}
601-
sed -i -e "s:# - name:- name:g" ${apacheOutput}
602-
sed -i -e "s:# hostPath: hostPath:g" ${apacheOutput}
603-
sed -i -e "s:# path: path:g" ${apacheOutput}
604-
sed -i -e "s:# volumeMounts:volumeMounts:g" ${apacheOutput}
605-
sed -i -e "s:# - name:- name:g" ${apacheOutput}
606-
sed -i -e "s:# mountPath: mountPath:g" ${apacheOutput}
607-
fi
608625

609626
# Apache security file
610627
cp ${apacheSecurityInput} ${apacheSecurityOutput}

0 commit comments

Comments
 (0)