@@ -1256,47 +1256,7 @@ encrypt_decrypt_domain_secret() {
1256
1256
}
1257
1257
1258
1258
# prepare mii server
1259
-
1260
- prepareMIIServer () {
1261
-
1262
- trace " Model-in-Image: Creating domain home."
1263
-
1264
- # primordial domain contain the basic structures, security and other fmwconfig templated info
1265
- # domainzip only contains the domain configuration (config.xml jdbc/ jms/)
1266
- # Both are needed for the complete domain reconstruction
1267
-
1268
- if [ ! -f /weblogic-operator/introspector/primordial_domainzip.secure ] ; then
1269
- trace SEVERE " Domain Source Type is FromModel, the primordial model archive is missing, cannot start server"
1270
- return 1
1271
- fi
1272
-
1273
- if [ ! -f /weblogic-operator/introspector/domainzip.secure ] ; then
1274
- trace SEVERE " Domain type is FromModel, the domain configuration archive is missing, cannot start server"
1275
- return 1
1276
- fi
1277
-
1278
- trace " Model-in-Image: Restoring primordial domain"
1279
- restorePrimordialDomain || return 1
1280
-
1281
- trace " Model-in-Image: Restore domain secret"
1282
- # decrypt the SerializedSystemIni first
1283
- if [ -f ${RUNTIME_ENCRYPTION_SECRET_PASSWORD} ] ; then
1284
- MII_PASSPHRASE=$( cat ${RUNTIME_ENCRYPTION_SECRET_PASSWORD} )
1285
- else
1286
- trace SEVERE " Domain Source Type is 'FromModel' which requires specifying a runtimeEncryptionSecret " \
1287
- " in your domain resource and deploying this secret with a 'password' key, but the secret does not have this key."
1288
- return 1
1289
- fi
1290
- encrypt_decrypt_domain_secret " decrypt" ${DOMAIN_HOME} ${MII_PASSPHRASE}
1291
-
1292
- # restore the config zip
1293
- #
1294
- trace " Model-in-Image: Restore domain config"
1295
- restoreDomainConfig || return 1
1296
-
1297
- # restore the archive apps and libraries
1298
- #
1299
- trace " Model-in-Image: Restoring apps and libraries"
1259
+ restorAppAndLibs () {
1300
1260
1301
1261
createFolder " ${DOMAIN_HOME} /lib" " This is the './lib' directory within DOMAIN_HOME directory 'domain.spec.domainHome'." || return 1
1302
1262
local WLSDEPLOY_DOMAINLIB=" wlsdeploy/domainLibraries"
@@ -1327,16 +1287,60 @@ prepareMIIServer() {
1327
1287
1328
1288
# expand the archive apps and shared lib to the wlsdeploy/* directories
1329
1289
# the config.xml is referencing them from that path
1330
-
1290
+ # exclude standalone app module in wlsdeploy/applications/*.xml since it is included int zipped up domain config
1291
+ # zip, the original xml in the archive may have wdt tokenized notations.
1331
1292
cd ${DOMAIN_HOME} || return 1
1332
- ${JAVA_HOME} /bin/jar xf ${IMG_ARCHIVES_ROOTDIR} /${file} wlsdeploy/
1293
+ unzip ${IMG_ARCHIVES_ROOTDIR} /${file} -x " wlsdeploy/domainBin/* "
1333
1294
if [ $? -ne 0 ] ; then
1334
1295
trace SEVERE " Domain Source Type is FromModel, error in extracting application archive ${IMG_ARCHIVES_ROOTDIR} /${file} "
1335
1296
return 1
1336
1297
fi
1337
- # No need to have domainLibraries in domain home
1338
- rm -fr ${WLSDEPLOY_DOMAINLIB}
1339
1298
done
1299
+
1300
+ }
1301
+
1302
+ prepareMIIServer () {
1303
+
1304
+ trace " Model-in-Image: Creating domain home."
1305
+
1306
+ # primordial domain contain the basic structures, security and other fmwconfig templated info
1307
+ # domainzip only contains the domain configuration (config.xml jdbc/ jms/)
1308
+ # Both are needed for the complete domain reconstruction
1309
+
1310
+ if [ ! -f /weblogic-operator/introspector/primordial_domainzip.secure ] ; then
1311
+ trace SEVERE " Domain Source Type is FromModel, the primordial model archive is missing, cannot start server"
1312
+ return 1
1313
+ fi
1314
+
1315
+ if [ ! -f /weblogic-operator/introspector/domainzip.secure ] ; then
1316
+ trace SEVERE " Domain type is FromModel, the domain configuration archive is missing, cannot start server"
1317
+ return 1
1318
+ fi
1319
+
1320
+ trace " Model-in-Image: Restoring primordial domain"
1321
+ restorePrimordialDomain || return 1
1322
+
1323
+ trace " Model-in-Image: Restore domain secret"
1324
+ # decrypt the SerializedSystemIni first
1325
+ if [ -f ${RUNTIME_ENCRYPTION_SECRET_PASSWORD} ] ; then
1326
+ MII_PASSPHRASE=$( cat ${RUNTIME_ENCRYPTION_SECRET_PASSWORD} )
1327
+ else
1328
+ trace SEVERE " Domain Source Type is 'FromModel' which requires specifying a runtimeEncryptionSecret " \
1329
+ " in your domain resource and deploying this secret with a 'password' key, but the secret does not have this key."
1330
+ return 1
1331
+ fi
1332
+ encrypt_decrypt_domain_secret " decrypt" ${DOMAIN_HOME} ${MII_PASSPHRASE}
1333
+
1334
+ # We restore the app and libs from the archive first, the domain zip may contain any standalone application
1335
+ # modules under wlsdeploy/applications/*.xml. In the next step, if any standalon application module exists collected
1336
+ # during introspection, it will overwrite the tokenized version in the archive.
1337
+
1338
+ trace " Model-in-Image: Restoring apps and libraries"
1339
+ restorAppAndLibs || return 1
1340
+
1341
+ trace " Model-in-Image: Restore domain config"
1342
+ restoreDomainConfig || return 1
1343
+
1340
1344
return 0
1341
1345
}
1342
1346
0 commit comments