Skip to content

Commit

Permalink
Merge branch 'ohs-prereq-v3' into 'main'
Browse files Browse the repository at this point in the history
New installer type added for OHS with DB 19 client

See merge request weblogic-cloud/weblogic-image-tool!469
  • Loading branch information
ddsharpe committed Apr 8, 2024
2 parents 227a353 + 55c0fb1 commit 3a646ae
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019, 2022, Oracle and/or its affiliates.
// Copyright (c) 2019, 2024, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

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

/**
* Validate patches conflicts by passing a list of patches.
* Check for patch conflicts by passing a list of patches.
*
* @param installedPatches opatch lsinventory content (null if none is passed)
* @param patches A list of patches number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ private List<String> getCommand(boolean showPasswords) {
result.add("buildx");
}
result.add("build");
result.add("--no-cache");
result.addAll(command);
if (additionalOptions != null && !additionalOptions.isEmpty()) {
result.addAll(additionalOptions);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019, 2023, Oracle and/or its affiliates.
// Copyright (c) 2019, 2024, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

package com.oracle.weblogic.imagetool.installer;
Expand Down Expand Up @@ -82,6 +82,9 @@ public enum FmwInstallerType {
OHS(Utils.toSet(AruProduct.OHS, AruProduct.OAM_WG, AruProduct.WLS, AruProduct.JDBC, AruProduct.FMWPLAT,
AruProduct.OSS, AruProduct.FIT),
InstallerType.OHS),
OHS_DB19(Utils.toSet(AruProduct.OHS, AruProduct.OAM_WG, AruProduct.WLS, AruProduct.JDBC, AruProduct.FMWPLAT,
AruProduct.OSS, AruProduct.FIT),
InstallerType.OHS, InstallerType.DB19),
ODI(Collections.singleton(AruProduct.ODI),
InstallerType.ODI)
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum InstallerType {
IDM("idm"),
OAM("oam"),
OHS("ohs"),
DB19("db19"),
OUD("oud"),
OID("oid"),
WCC("wcc"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
Expand Down Expand Up @@ -41,6 +42,9 @@ public MiddlewareInstall(FmwInstallerType type, String version, List<Path> respo
pkg.type = installer;
pkg.installer = new CachedFile(installer, version, buildPlatform);
pkg.responseFile = new DefaultResponseFile(installer, type);
if (installer.equals(InstallerType.DB19)) {
pkg.preinstallCommands = Collections.singletonList("34761383/changePerm.sh /u01/oracle");
}
addInstaller(pkg);
}
setResponseFiles(responseFiles);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
// Copyright (c) 2020, 2024, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

package com.oracle.weblogic.imagetool.installer;

import java.util.List;

import com.oracle.weblogic.imagetool.api.model.CachedFile;

public class MiddlewareInstallPackage {
Expand All @@ -11,6 +13,7 @@ public class MiddlewareInstallPackage {
CachedFile installer;
String installerFilename;
String jarName;
List<String> preinstallCommands;
boolean isZip = true;
boolean isBin = false;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021, Oracle and/or its affiliates.
# Copyright (c) 2021, 2024, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# Installing Middleware
Expand Down Expand Up @@ -36,17 +36,26 @@ USER {{userid}}

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

{{> fmw-patching}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021, Oracle and/or its affiliates.
// Copyright (c) 2021, 2024, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

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

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

@Test
Expand Down

0 comments on commit 3a646ae

Please sign in to comment.