|
1 | 1 | #!/usr/bin/env bash |
2 | | -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. |
| 2 | +# Copyright (c) 2018, 2022, Oracle and/or its affiliates. |
3 | 3 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. |
4 | 4 | # |
5 | 5 | # This script contains the all the function of model in image |
@@ -1054,12 +1054,22 @@ function wdtHandleOnlineUpdate() { |
1054 | 1054 | mkdir -p ${DOMAIN_HOME}/lib || exitOrLoop |
1055 | 1055 | for file in $(sort_files ${IMG_ARCHIVES_ROOTDIR} "*.zip") |
1056 | 1056 | 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 |
1058 | 1058 | 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 |
1060 | 1065 |
|
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}" |
1063 | 1073 | exitOrLoop |
1064 | 1074 | fi |
1065 | 1075 |
|
@@ -1290,21 +1300,25 @@ function prepareMIIServer() { |
1290 | 1300 |
|
1291 | 1301 | for file in $(sort_files ${IMG_ARCHIVES_ROOTDIR} "*.zip") |
1292 | 1302 | 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} |
1296 | 1303 |
|
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 |
1300 | 1311 | fi |
1301 | 1312 |
|
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 |
1306 | 1321 | fi |
1307 | | - rm -fr wlsdeploy/ |
1308 | 1322 |
|
1309 | 1323 | # expand the archive apps and shared lib to the wlsdeploy/* directories |
1310 | 1324 | # the config.xml is referencing them from that path |
|
0 commit comments