Skip to content

Commit 3a646ae

Browse files
committed
Merge branch 'ohs-prereq-v3' into 'main'
New installer type added for OHS with DB 19 client See merge request weblogic-cloud/weblogic-image-tool!469
2 parents 227a353 + 55c0fb1 commit 3a646ae

File tree

8 files changed

+38
-19
lines changed

8 files changed

+38
-19
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2019, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.aru;
@@ -167,7 +167,7 @@ public List<AruPatch> getRecommendedPatches(FmwInstallerType type, String versio
167167
for (AruProduct product : type.products()) {
168168
List<AruPatch> patches = getRecommendedPatches(product, version, userId, password);
169169
// temporary, until OHS stops using same release number and product ID for two different installs
170-
if (type == FmwInstallerType.OHS) {
170+
if (type == FmwInstallerType.OHS_DB19) {
171171
if (product == AruProduct.OHS) {
172172
patches = patches.stream().filter(p -> p.description().contains(" DB19C "))
173173
.collect(Collectors.toList());
@@ -267,7 +267,7 @@ public PatchLists(List<InstalledPatch> installedPatches, List<AruPatch> candidat
267267
}
268268

269269
/**
270-
* Validate patches conflicts by passing a list of patches.
270+
* Check for patch conflicts by passing a list of patches.
271271
*
272272
* @param installedPatches opatch lsinventory content (null if none is passed)
273273
* @param patches A list of patches number

imagetool/src/main/java/com/oracle/weblogic/imagetool/builder/BuildCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ private List<String> getCommand(boolean showPasswords) {
260260
result.add("buildx");
261261
}
262262
result.add("build");
263-
result.add("--no-cache");
264263
result.addAll(command);
265264
if (additionalOptions != null && !additionalOptions.isEmpty()) {
266265
result.addAll(additionalOptions);

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/FmwInstallerType.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2019, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.installer;
@@ -82,6 +82,9 @@ public enum FmwInstallerType {
8282
OHS(Utils.toSet(AruProduct.OHS, AruProduct.OAM_WG, AruProduct.WLS, AruProduct.JDBC, AruProduct.FMWPLAT,
8383
AruProduct.OSS, AruProduct.FIT),
8484
InstallerType.OHS),
85+
OHS_DB19(Utils.toSet(AruProduct.OHS, AruProduct.OAM_WG, AruProduct.WLS, AruProduct.JDBC, AruProduct.FMWPLAT,
86+
AruProduct.OSS, AruProduct.FIT),
87+
InstallerType.OHS, InstallerType.DB19),
8588
ODI(Collections.singleton(AruProduct.ODI),
8689
InstallerType.ODI)
8790
;

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/InstallerType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public enum InstallerType {
2020
IDM("idm"),
2121
OAM("oam"),
2222
OHS("ohs"),
23+
DB19("db19"),
2324
OUD("oud"),
2425
OID("oid"),
2526
WCC("wcc"),

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/MiddlewareInstall.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.nio.file.Files;
99
import java.nio.file.Path;
1010
import java.util.ArrayList;
11+
import java.util.Collections;
1112
import java.util.Enumeration;
1213
import java.util.List;
1314
import java.util.zip.ZipEntry;
@@ -41,6 +42,9 @@ public MiddlewareInstall(FmwInstallerType type, String version, List<Path> respo
4142
pkg.type = installer;
4243
pkg.installer = new CachedFile(installer, version, buildPlatform);
4344
pkg.responseFile = new DefaultResponseFile(installer, type);
45+
if (installer.equals(InstallerType.DB19)) {
46+
pkg.preinstallCommands = Collections.singletonList("34761383/changePerm.sh /u01/oracle");
47+
}
4448
addInstaller(pkg);
4549
}
4650
setResponseFiles(responseFiles);
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.installer;
55

6+
import java.util.List;
7+
68
import com.oracle.weblogic.imagetool.api.model.CachedFile;
79

810
public class MiddlewareInstallPackage {
@@ -11,6 +13,7 @@ public class MiddlewareInstallPackage {
1113
CachedFile installer;
1214
String installerFilename;
1315
String jarName;
16+
List<String> preinstallCommands;
1417
boolean isZip = true;
1518
boolean isBin = false;
1619
}

imagetool/src/main/resources/docker-files/install-middleware.mustache

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2024, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# Installing Middleware
@@ -36,17 +36,26 @@ USER {{userid}}
3636

3737
RUN echo "INSTALLING MIDDLEWARE" \
3838
{{#installPackages}}
39-
&& echo "INSTALLING {{type}}" \
40-
&& {{#isZip}}unzip -q {{{tempDir}}}/{{installerFilename}} "*.[jb][ai][rn]" -d {{{tempDir}}} &&{{/isZip}} \
41-
{{^isBin}}{{{java_home}}}/bin/java -Xmx1024m -jar {{{tempDir}}}/{{jarName}} -silent ORACLE_HOME={{{oracle_home}}} \
42-
-responseFile {{{tempDir}}}/{{responseFile.name}} -invPtrLoc {{inv_loc}}/oraInst.loc -ignoreSysPrereqs -force -novalidation {{/isBin}} \
43-
{{#isBin}}chmod +x {{{tempDir}}}/{{jarName}} && \
44-
{{{tempDir}}}/{{jarName}} -force -ignoreSysPrereqs -silent -responseFile {{{tempDir}}}/{{responseFile.name}} \
45-
-invPtrLoc {{inv_loc}}/oraInst.loc ORACLE_HOME={{{oracle_home}}} -jreLoc {{{java_home}}} {{/isBin}} \
39+
&& echo "INSTALLING {{type}}" \
40+
# If installer is packaged in a ZIP, extract it before running it
41+
{{#isZip}}&& unzip -q {{{tempDir}}}/{{installerFilename}} -d {{{tempDir}}}/{{{type}}} {{/isZip}} \
42+
{{#preinstallCommands}}&& {{{tempDir}}}/{{{type}}}/{{{.}}} {{/preinstallCommands}} \
43+
# IF the installer is a JAR file (not a .bin), run the silent install using Java
44+
{{^isBin}} && {{{java_home}}}/bin/java -Xmx1024m -jar {{{tempDir}}}/{{{type}}}/{{jarName}} \
45+
-silent ORACLE_HOME={{{oracle_home}}} \
46+
-responseFile {{{tempDir}}}/{{responseFile.name}} \
47+
-invPtrLoc {{inv_loc}}/oraInst.loc \
48+
-ignoreSysPrereqs -force -novalidation {{/isBin}} \
49+
# If the installer is a BIN, make sure it is executable and run the installer
50+
{{#isBin}} && chmod +x {{{tempDir}}}/{{{type}}}/{{jarName}} \
51+
&& {{{tempDir}}}/{{{type}}}/{{jarName}} \
52+
-force -ignoreSysPrereqs -silent \
53+
-responseFile {{{tempDir}}}/{{responseFile.name}} \
54+
-invPtrLoc {{inv_loc}}/oraInst.loc ORACLE_HOME={{{oracle_home}}} -jreLoc {{{java_home}}} {{/isBin}} \
4655
{{/installPackages}}
47-
&& test $? -eq 0 \
48-
&& chmod -R g+r {{{oracle_home}}} \
49-
|| (grep -vh "NOTIFICATION" /tmp/OraInstall*/install*.log && exit 1)
56+
&& test $? -eq 0 \
57+
&& chmod -R g+r {{{oracle_home}}} \
58+
|| (grep -vh "NOTIFICATION" /tmp/OraInstall*/install*.log && exit 1)
5059

5160
{{> fmw-patching}}
5261

imagetool/src/test/java/com/oracle/weblogic/imagetool/builder/BuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.builder;
@@ -17,7 +17,7 @@ class BuilderTest {
1717
private static final String BUILD_ENGINE = "docker";
1818

1919
private String expected(String options) {
20-
return String.format("%s build --no-cache %s %s", BUILD_ENGINE, options, BUILD_CONTEXT);
20+
return String.format("%s build %s %s", BUILD_ENGINE, options, BUILD_CONTEXT);
2121
}
2222

2323
@Test

0 commit comments

Comments
 (0)