File tree Expand file tree Collapse file tree 6 files changed +507
-14
lines changed
artifacts/opt/jboss/container/java/jlink
bash/artifacts/usr/local/s2i Expand file tree Collapse file tree 6 files changed +507
-14
lines changed Original file line number Diff line number Diff line change
1
+ jlink_preflight_check ()
2
+ {
3
+ # preflight check: do we have what we need?
4
+ if [ " $JAVA_VERSION " -lt 11 ]; then
5
+ echo " Jlink integration not available for JDK${JAVA_VERSION} !"
6
+ echo " Jlink integration is only supported for JDK versions 11 and newer."
7
+ exit 1
8
+ fi
9
+ if [ ! -d /usr/lib/jvm/java/jmods ]; then
10
+ echo " Jlink integration requires the jmods RPM to be installed in the builder image, e.g."
11
+ echo " microdnf install -y java-${JAVA_VERSION} -openjdk-jmods"
12
+ exit 1
13
+ fi
14
+ }
Original file line number Diff line number Diff line change
1
+ @ubi9/openjdk-11
2
+ @ubi9/openjdk-17
3
+ @ubi9/openjdk-21
4
+ Feature : Openshift OpenJDK S2I tests (jlink specific )
5
+ Scenario : Ensure jlinked builder is used to build the containerized application image
6
+ Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i
7
+ | variable | value |
8
+ | S2I_ENABLE_JLINK | true |
9
+ | QUARKUS_PACKAGE_TYPE | uber -jar |
10
+ Then run ls /tmp/jre in container and check its output for bin
11
+
12
+ Scenario : Ensure S2I_ENABLE_JLINK is not set to true
13
+ Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i
14
+ Then container log should not contain S2I_ENABLE_JLINK=true
15
+ And run bash -c "test ! -d /tmp/jre && echo PASS" in container and immediately check its output for PASS
Original file line number Diff line number Diff line change @@ -59,3 +59,4 @@ modules:
59
59
- name : jboss.container.user
60
60
- name : jboss.container.java.jvm
61
61
- name : jboss.container.util.logging
62
+ - name : jboss.container.util.pathfinder
Original file line number Diff line number Diff line change @@ -16,22 +16,28 @@ maven_s2i_build
16
16
17
17
# run the pathfinder scripts to define JAVA_APP_JAR and JAVA_LIB_DIR
18
18
source " ${JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE} /pathfinder.sh"
19
- echo " Setting up java app and lib variables"
20
19
setup_java_app_and_lib
21
20
22
21
# include our jlink scripts
23
- source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkdeps.sh"
24
- echo " Invoking mkdeps"
25
- generate_deps
22
+ if [ " $S2I_ENABLE_JLINK " = " true" ]; then
26
23
27
- source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkstrippeddeps.sh"
28
- echo " Stripping dependencies"
29
- mkstrippeddeps
24
+ source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /preflight.sh"
25
+ jlink_preflight_check
30
26
31
- source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /generatejdkdeps .sh"
32
- echo " Generating JDK dependencies "
33
- generatejdkdeps
27
+ source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkdeps .sh"
28
+ echo " Invoking mkdeps "
29
+ generate_deps
34
30
35
- source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkjreimage.sh"
36
- echo " Linking jre"
37
- generate_jre_image
31
+ source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkstrippeddeps.sh"
32
+ echo " Stripping dependencies"
33
+ mkstrippeddeps
34
+
35
+ source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /generatejdkdeps.sh"
36
+ echo " Generating JDK dependencies"
37
+ generatejdkdeps
38
+
39
+ source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkjreimage.sh"
40
+ echo " Linking jre"
41
+ generate_jre_image
42
+
43
+ fi
Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ envs:
116
116
description : ^
117
117
Enables the Jdeps/JLink workflow to minimize JRE size
118
118
example : " false"
119
- value : " false"
120
119
121
120
run :
122
121
cmd :
You can’t perform that action at this time.
0 commit comments