File tree 2 files changed +26
-14
lines changed
run/artifacts/opt/jboss/container/java/run
s2i/bash/artifacts/usr/local/s2i
2 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,16 @@ function configure_passwd() {
227
227
fi
228
228
}
229
229
230
+ handle_java_options () {
231
+ # JAVA_OPTIONS is a deprecated name for JAVA_OPTS. It is not supported
232
+ # in the images from UBI9 onwards.
233
+ if [ -z " ${JAVA_OPTS+isunset} " ] && [ -n " ${JAVA_OPTIONS+isset} " ]; then
234
+ JAVA_OPTS=" $JAVA_OPTIONS "
235
+ fi
236
+ export JAVA_OPTS
237
+ export JAVA_OPTIONS=" $JAVA_OPTS "
238
+ }
239
+
230
240
# Start JVM
231
241
startup () {
232
242
# Initialize environment
@@ -251,4 +261,13 @@ startup() {
251
261
252
262
# =============================================================================
253
263
# Fire up
254
- startup $*
264
+
265
+ handle_java_options
266
+
267
+ if [ -f " ${S2I_TARGET_DEPLOYMENTS_DIR} /bin/run.sh" ]; then
268
+ echo " Starting the application using the bundled ${S2I_TARGET_DEPLOYMENTS_DIR} /bin/run.sh ..."
269
+ exec ${DEPLOYMENTS_DIR} /bin/run.sh $* ${JAVA_ARGS}
270
+ else
271
+ echo " Starting the Java application using ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /run-java.sh $* ..."
272
+ startup $* ${JAVA_ARGS}
273
+ fi
Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core-hooks"
11
11
# Global S2I variable setup
12
12
s2i_core_env_init
13
13
14
- if [ -z " ${JAVA_OPTS+isunset} " ] && [ -n " ${JAVA_OPTIONS+isset} " ]; then
15
- JAVA_OPTS=" $JAVA_OPTIONS "
16
- fi
17
-
18
14
if [ -f " ${JBOSS_CONTAINER_JOLOKIA_MODULE} /jolokia-opts" ]; then
19
15
# Always include jolokia-opts, which can be empty if switched off via env
20
16
S2I_RUN_OPTS=" ${S2I_RUN_OPTS} $( ${JBOSS_CONTAINER_JOLOKIA_MODULE} /jolokia-opts) "
@@ -24,13 +20,10 @@ if [ -f "${JBOSS_CONTAINER_PROMETHEUS_MODULE}/prometheus-opts" ]; then
24
20
fi
25
21
26
22
export S2I_RUN_OPTS
27
- export JAVA_OPTS
28
- export JAVA_OPTIONS=" $JAVA_OPTS "
29
23
30
- if [ -f " ${S2I_TARGET_DEPLOYMENTS_DIR} /bin/run.sh" ]; then
31
- echo " Starting the application using the bundled ${S2I_TARGET_DEPLOYMENTS_DIR} /bin/run.sh ..."
32
- exec ${DEPLOYMENTS_DIR} /bin/run.sh $args ${JAVA_ARGS}
33
- else
34
- echo " Starting the Java application using ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /run-java.sh $args ..."
35
- exec " ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /run-java.sh" $args ${JAVA_ARGS}
36
- fi
24
+ # XXX this is needed to support a user-provided alternative run script but we
25
+ # should probably export all relevant S2I variables, possibly by moving the
26
+ # above `source` statements into run-java.sh
27
+ export S2I_TARGET_DEPLOYMENTS_DIR
28
+
29
+ exec " ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /run-java.sh" $args
You can’t perform that action at this time.
0 commit comments