-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7749 from iocanel/s2i-jar-path
fix(#7712): S2i build no longer renames artifacts
- Loading branch information
Showing
9 changed files
with
402 additions
and
64 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
.../deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBaseJavaImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
package io.quarkus.container.image.s2i.deployment; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.container.image.deployment.util.ImageUtil; | ||
|
||
public enum S2iBaseJavaImage { | ||
|
||
//We only compare `repositories` so registries and tags are stripped | ||
FABRIC8("fabric8/s2i-java:latest", "JAVA_MAIN_CLASS", "JAVA_APP_JAR", "JAVA_LIB_DIR", "JAVA_CLASSPATH", "JAVA_OPTIONS"), | ||
OPENJDK_8_RHEL7("redhat-openjdk-18/openjdk18-openshift:latest", "JAVA_MAIN_CLASS", "JAVA_APP_JAR", "JAVA_LIB_DIR", | ||
"JAVA_CLASSPATH", "JAVA_OPTIONS"), | ||
OPENJDK_8_RHEL8("openjdk/openjdk-8-rhel8:latest", "JAVA_MAIN_CLASS", "JAVA_APP_JAR", "JAVA_LIB_DIR", "JAVA_CLASSPATH", | ||
"JAVA_OPTIONS"), | ||
OPENJDK_11_RHEL7("openjdk/openjdk-11-rhel7:latest", "JAVA_MAIN_CLASS", "JAVA_APP_JAR", "JAVA_LIB_DIR", "JAVA_CLASSPATH", | ||
"JAVA_OPTIONS"), | ||
OPENJDK_11_RHEL8("openjdk/openjdk-11-rhel8:latest", "JAVA_MAIN_CLASS", "JAVA_APP_JAR", "JAVA_LIB_DIR", "JAVA_CLASSPATH", | ||
"JAVA_OPTIONS"); | ||
|
||
private final String image; | ||
private final String javaMainClassEnvVar; | ||
private final String jarEnvVar; | ||
private final String jarLibEnvVar; | ||
private final String classpathEnvVar; | ||
private final String jvmOptionsEnvVar; | ||
|
||
public static Optional<S2iBaseJavaImage> findMatching(String image) { | ||
for (S2iBaseJavaImage candidate : S2iBaseJavaImage.values()) { | ||
if (ImageUtil.getRepository(candidate.getImage()).equals(ImageUtil.getRepository(image))) { | ||
return Optional.of(candidate); | ||
} | ||
} | ||
return Optional.empty(); | ||
} | ||
|
||
private S2iBaseJavaImage(String image, String javaMainClassEnvVar, String jarEnvVar, String jarLibEnvVar, | ||
String classpathEnvVar, String jvmOptionsEnvVar) { | ||
this.image = image; | ||
this.javaMainClassEnvVar = javaMainClassEnvVar; | ||
this.jarEnvVar = jarEnvVar; | ||
this.jarLibEnvVar = jarLibEnvVar; | ||
this.classpathEnvVar = classpathEnvVar; | ||
this.jvmOptionsEnvVar = jvmOptionsEnvVar; | ||
} | ||
|
||
public String getImage() { | ||
return image; | ||
} | ||
|
||
public String getJavaMainClassEnvVar() { | ||
return javaMainClassEnvVar; | ||
} | ||
|
||
public String getJvmOptionsEnvVar() { | ||
return jvmOptionsEnvVar; | ||
} | ||
|
||
public String getClasspathEnvVar() { | ||
return classpathEnvVar; | ||
} | ||
|
||
public String getJarLibEnvVar() { | ||
return jarLibEnvVar; | ||
} | ||
|
||
public String getJarEnvVar() { | ||
return jarEnvVar; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...eployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBaseNativeImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
package io.quarkus.container.image.s2i.deployment; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.container.image.deployment.util.ImageUtil; | ||
|
||
public enum S2iBaseNativeImage { | ||
|
||
//We only compare `repositories` so registries and tags are stripped | ||
QUARKUS("quarkus/ubi-quarkus-native-binary-s2i:latest", "application", "QUARKUS_HOME", "QUARKUS_OPTS"); | ||
|
||
private final String image; | ||
private final String fixedNativeBinaryName; | ||
private final String homeDirEnvVar; | ||
private final String optsEnvVar; | ||
|
||
public static Optional<S2iBaseNativeImage> findMatching(String image) { | ||
for (S2iBaseNativeImage candidate : S2iBaseNativeImage.values()) { | ||
if (ImageUtil.getRepository(candidate.getImage()).equals(ImageUtil.getRepository(image))) { | ||
return Optional.of(candidate); | ||
} | ||
} | ||
return Optional.empty(); | ||
} | ||
|
||
private S2iBaseNativeImage(String image, String fixedNativeBinaryName, String homeDirEnvVar, String optsEnvVar) { | ||
this.image = image; | ||
this.fixedNativeBinaryName = fixedNativeBinaryName; | ||
this.homeDirEnvVar = homeDirEnvVar; | ||
this.optsEnvVar = optsEnvVar; | ||
} | ||
|
||
public String getImage() { | ||
return image; | ||
} | ||
|
||
public String getFixedNativeNinaryName() { | ||
return this.fixedNativeBinaryName; | ||
} | ||
|
||
public String getHomeDirEnvVar() { | ||
return homeDirEnvVar; | ||
} | ||
|
||
public String getOptsEnvVar() { | ||
return optsEnvVar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.