Skip to content

Commit 7fb578b

Browse files
Adding support for WDT tar.gz installer (#277)
1 parent c992ac3 commit 7fb578b

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/DockerfileOptions.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,19 @@ public boolean isWdtEnabled() {
534534
return useWdt;
535535
}
536536

537+
/**
538+
* Referenced by the Dockerfile template to determine which command to use to install WDT.
539+
*
540+
* @return true if the WDT installer file is a tar.gz file; false otherwise.
541+
*/
542+
public boolean usingWdtTarGzInstaller() {
543+
boolean result = false;
544+
if (wdtInstallerFilename != null && wdtInstallerFilename.toLowerCase().endsWith(".tar.gz")) {
545+
result = true;
546+
}
547+
return result;
548+
}
549+
537550
/**
538551
* copyOraInst check if it needs to copy the oraInst.loc file.
539552
*
@@ -773,8 +786,9 @@ public String wdtInstaller() {
773786
return wdtInstallerFilename;
774787
}
775788

776-
public void setWdtInstallerFilename(String value) {
789+
public DockerfileOptions setWdtInstallerFilename(String value) {
777790
wdtInstallerFilename = value;
791+
return this;
778792
}
779793

780794
public boolean modelOnly() {

imagetool/src/main/resources/docker-files/Create_Image.mustache

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ RUN echo "INSTALLING MIDDLEWARE" \
115115
{{{.}}}
116116
{{/beforeWdtCommand}}
117117

118-
RUN unzip -q {{{tempDir}}}/{{{wdtInstaller}}} -d {{{wdt_home}}}
118+
{{#usingWdtTarGzInstaller}}
119+
RUN tar zxf {{{tempDir}}}/{{{wdtInstaller}}} -C {{{wdt_home}}}
120+
{{/usingWdtTarGzInstaller}}
121+
{{^usingWdtTarGzInstaller}}
122+
RUN unzip -q {{{tempDir}}}/{{{wdtInstaller}}} -d {{{wdt_home}}}
123+
{{/usingWdtTarGzInstaller}}
124+
119125
{{^modelOnly}}
120126
RUN cd {{{wdt_home}}}/weblogic-deploy/bin \
121127
&& {{#isWdtUseEncryption}}echo {{{wdtEncryptionKey}}} | {{/isWdtUseEncryption}} ./createDomain.sh \

imagetool/src/test/java/com/oracle/weblogic/imagetool/util/DockerfileBuilderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void validateMustacheAliases() throws IOException {
3737
.setWdtDomainType("WLS")
3838
.setWdtModels(Arrays.asList("model1.yaml", "model2.yaml"))
3939
.setPackageInstaller(PackageManagerType.YUM)
40+
.setWdtInstallerFilename("weblogic-deploy.zip")
4041
.setMiddlewareInstall(install);
4142

4243
MustacheFactory mf = new DefaultMustacheFactory(new File("src/main/resources/docker-files"));

0 commit comments

Comments
 (0)