Skip to content

Commit 9e32456

Browse files
Merge pull request #2704 from oracle/backport_owls_95448
backport owls_95448 to release 3.3
2 parents 67d322f + 8579025 commit 9e32456

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

operator/src/main/resources/scripts/modelInImage.sh

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2018, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# This script contains the all the function of model in image
@@ -1054,12 +1054,22 @@ function wdtHandleOnlineUpdate() {
10541054
mkdir -p ${DOMAIN_HOME}/lib || exitOrLoop
10551055
for file in $(sort_files ${IMG_ARCHIVES_ROOTDIR} "*.zip")
10561056
do
1057-
# expand the archive domain libraries to the domain lib
1057+
# expand the archive domain libraries to the domain lib, 11 is caution when zip entry doesn't exists
10581058
cd ${DOMAIN_HOME}/lib || exitOrLoop
1059-
${JAVA_HOME}/bin/jar xf ${IMG_ARCHIVES_ROOTDIR}/${file} wlsdeploy/domainLibraries/
1059+
unzip -jo ${IMG_ARCHIVES_ROOTDIR}/${file} wlsdeploy/domainLibraries/*
1060+
if [ $? -ne 0 && $? -ne 11 ] ; then
1061+
trace SEVERE "Domain Source Type is FromModel, error in extracting domainLibraries " \
1062+
"${IMG_ARCHIVES_ROOTDIR}/${file}"
1063+
exitOrLoop
1064+
fi
10601065

1061-
if [ $? -ne 0 ] ; then
1062-
trace SEVERE "Error extracting domain lib '${IMG_ARCHIVES_ROOTDIR}/${file}'"
1066+
# expand the domain bin, in update case user may only update a file in the domainBin archive, 11 is caution when
1067+
# zip entry doesn't exists
1068+
cd ${DOMAIN_HOME}/bin || exitOrLoop
1069+
unzip -jo ${IMG_ARCHIVES_ROOTDIR}/${file} wlsdeploy/domainBin/*
1070+
if [ $? -ne 0 && $? -ne 11 ] ; then
1071+
trace SEVERE "Domain Source Type is FromModel, error in extracting domainBin " \
1072+
"${IMG_ARCHIVES_ROOTDIR}/${file}"
10631073
exitOrLoop
10641074
fi
10651075

@@ -1290,21 +1300,25 @@ function prepareMIIServer() {
12901300

12911301
for file in $(sort_files ${IMG_ARCHIVES_ROOTDIR} "*.zip")
12921302
do
1293-
# expand the archive domain libraries to the domain lib
1294-
cd ${DOMAIN_HOME}/lib || return 1
1295-
${JAVA_HOME}/bin/jar xf ${IMG_ARCHIVES_ROOTDIR}/${file} ${WLSDEPLOY_DOMAINLIB}
12961303

1297-
if [ $? -ne 0 ] ; then
1298-
trace SEVERE "Domain Source Type is FromModel, error in extracting domain libs ${IMG_ARCHIVES_ROOTDIR}/${file}"
1299-
return 1
1304+
# expand the archive domain libraries to the domain lib, 11 is caution when zip entry doesn't exists
1305+
cd ${DOMAIN_HOME}/lib || exitOrLoop
1306+
unzip -jo ${IMG_ARCHIVES_ROOTDIR}/${file} wlsdeploy/domainLibraries/*
1307+
if [ $? -ne 0 && $? -ne 11 ] ; then
1308+
trace SEVERE "Domain Source Type is FromModel, error in extracting domainLibraries " \
1309+
"${IMG_ARCHIVES_ROOTDIR}/${file}"
1310+
exitOrLoop
13001311
fi
13011312

1302-
# Flatten the jars to the domain lib root
1303-
1304-
if [ -d ${WLSDEPLOY_DOMAINLIB} ] && [ "$(ls -A ${WLSDEPLOY_DOMAINLIB})" ] ; then
1305-
mv ${WLSDEPLOY_DOMAINLIB}/* .
1313+
# expand the domain bin, in update case user may only update a file in the domainBin archive, 11 is caution when
1314+
# zip entry doesn't exists
1315+
cd ${DOMAIN_HOME}/bin || exitOrLoop
1316+
unzip -jo ${IMG_ARCHIVES_ROOTDIR}/${file} wlsdeploy/domainBin/*
1317+
if [ $? -ne 0 && $? -ne 11 ] ; then
1318+
trace SEVERE "Domain Source Type is FromModel, error in extracting domainBin " \
1319+
"${IMG_ARCHIVES_ROOTDIR}/${file}"
1320+
exitOrLoop
13061321
fi
1307-
rm -fr wlsdeploy/
13081322

13091323
# expand the archive apps and shared lib to the wlsdeploy/* directories
13101324
# the config.xml is referencing them from that path

0 commit comments

Comments
 (0)