File tree Expand file tree Collapse file tree 8 files changed +51
-13
lines changed
jlink/artifacts/opt/jboss/container/java/jlink
run/artifacts/opt/jboss/container/java/run
bash/artifacts/usr/local/s2i
core/artifacts/opt/jboss/container/s2i/core
artifacts/opt/jboss/container/util/pathfinder Expand file tree Collapse file tree 8 files changed +51
-13
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
function generatejdkdeps() {
4
+ echo " Generating JDK deps"
4
5
$JAVA_HOME /bin/java --list-modules > java-modules.txt
5
6
< java-modules.txt sed " s/\\ @.*//" > modules.txt
6
7
grep -Fx -f stripped-deps.txt modules.txt | tr ' \n' ' ,' | tr -d " [:space:]" > module-deps.txt
Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ function generate_deps() {
10
10
if [[ -v JAVA_LIB_DIR ]]; then
11
11
# copy dependencies found in libs to dependencies
12
12
find $JAVA_LIB_DIR -type f -name ' *.jar' -print0 | xargs -r0 cp -vt dependencies
13
+ echo " Working with: "
14
+ echo $JAVA_APP_JAR
15
+ echo $JAVA_LIB_DIR
13
16
# generate the dependency list
14
17
$JAVA_HOME /bin/jdeps --multi-release $JAVA_VERSION -R -s \
15
18
--module-path dependencies \
16
19
" $JAVA_APP_JAR " \
17
20
" $JAVA_LIB_DIR " /** /* .jar \
18
21
> deps.txt
19
- cat deps.txt
20
22
else
21
23
$JAVA_HOME /bin/jdeps --multi-release $JAVA_VERSION -R -s \
22
24
--module-path dependencies \
Original file line number Diff line number Diff line change @@ -26,14 +26,16 @@ load_env() {
26
26
# Configuration stuff is read from this file
27
27
local run_env_sh=" run-env.sh"
28
28
29
- # Load JAVA_APP_JAR and JAVA_LIB_DIR
30
- if [ -f " ${JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE} /pathfinder.sh" ]; then
31
- source " $JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE /pathfinder.sh"
32
- fi
33
29
# Load default default config
34
30
if [ -f " ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /${run_env_sh} " ]; then
35
31
source " ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /${run_env_sh} "
36
32
fi
33
+
34
+ # Load JAVA_APP_JAR and JAVA_LIB_DIR
35
+ if [ -f " ${JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE} /pathfinder.sh" ]; then
36
+ source " $JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE /pathfinder.sh"
37
+ setup_java_app_and_lib
38
+ fi
37
39
}
38
40
39
41
# Combine all java options
Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core-hooks"
11
11
# inject our overridden maven_s2i_*() functions
12
12
source " ${JBOSS_CONTAINER_JAVA_S2I_MODULE} /maven-s2i-overrides"
13
13
14
- # run the pathfinder scripts to define JAVA_APP_JAR and JAVA_LIB_DIR
15
- source " ${JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE} /pathfinder.sh"
16
-
17
14
# invoke the build
18
15
maven_s2i_build
19
16
17
+ # run the pathfinder scripts to define JAVA_APP_JAR and JAVA_LIB_DIR
18
+ source " ${JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE} /pathfinder.sh"
19
+ echo " Setting up java app and lib variables"
20
+ setup_java_app_and_lib
21
+
20
22
# include our jlink scripts
21
23
source " ${JBOSS_CONTAINER_JAVA_JLINK_MODULE} /mkdeps.sh"
22
24
echo " Invoking mkdeps"
Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ function s2i_core_copy_data() {
82
82
# copy deployment (binary) files
83
83
# $1 - the base directory to which $S2I_SOURCE_DEPLOYMENTS_DIR is appended
84
84
function s2i_core_copy_deployments() {
85
- echo "Copying deployments"
86
85
if [ -d "${1}/${S2I_SOURCE_DEPLOYMENTS_DIR}" ]; then
87
86
if [ -z "${S2I_TARGET_DEPLOYMENTS_DIR}" ]; then
88
87
log_warning "Unable to copy deployment files. No target directory specified for S2I_TARGET_DEPLOYMENTS_DIR"
Original file line number Diff line number Diff line change 1
-
1
+ # Error is indicated with a prefix in the return value
2
+ check_error () {
3
+ local msg=$1
4
+ if echo ${msg} | grep -q " ^ERROR:" ; then
5
+ log_error ${msg}
6
+ exit 1
7
+ fi
8
+ }
2
9
3
10
# detect Quarkus fast-jar package type (OPENJDK-631)
4
11
is_quarkus_fast_jar () {
@@ -59,6 +66,14 @@ get_jar_file() {
59
66
}
60
67
61
68
setup_java_app_and_lib () {
69
+ # Configuration stuff is read from this file
70
+ local run_env_sh=" run-env.sh"
71
+
72
+ # Load default default config
73
+ if [ -f " ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /${run_env_sh} " ]; then
74
+ source " ${JBOSS_CONTAINER_JAVA_RUN_MODULE} /${run_env_sh} "
75
+ fi
76
+
62
77
# Check also $JAVA_APP_DIR. Overrides other defaults
63
78
# It's valid to set the app dir in the default script
64
79
if [ -z " ${JAVA_APP_DIR} " ]; then
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ # Configure module
3
+ set -e
4
+
5
+ SCRIPT_DIR=$( dirname $0 )
6
+ ARTIFACTS_DIR=${SCRIPT_DIR} /artifacts
7
+
8
+ chown -R default:root $SCRIPT_DIR
9
+ chmod -R ug+rwX $SCRIPT_DIR
10
+ chmod ug+x ${ARTIFACTS_DIR} /opt/jboss/container/util/pathfinder/*
11
+
12
+ pushd ${ARTIFACTS_DIR}
13
+ cp -pr * /
14
+ popd
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ description: ^
7
7
as well as library directories"
8
8
9
9
envs :
10
- - name : JBOSS_CONTAINER_JAVA_S2I_MODULE
10
+ - name : JBOSS_CONTAINER_UTIL_PATHFINDER_MODULE
11
11
value : /opt/jboss/container/util/pathfinder
12
-
12
+
13
13
- name : JAVA_APP_DIR
14
14
description : ^
15
15
The directory where the application resides. All paths in your application
28
28
Directory holding the Java jar files as well an optional `classpath` file
29
29
which holds the classpath. Either as a single line classpath (colon
30
30
separated) or with jar files listed line-by-line. If not set
31
- **JAVA_LIB_DIR** is the same as **JAVA_APP_DIR**.
31
+ **JAVA_LIB_DIR** is the same as **JAVA_APP_DIR**.
32
+
33
+ execute :
34
+ - script : configure.sh
You can’t perform that action at this time.
0 commit comments