Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# include dependencies
source "${JBOSS_CONTAINER_UTIL_LOGGING_MODULE}/logging.sh"
source "${JBOSS_CONTAINER_S2I_CORE_MODULE}/s2i-core"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an implicit dependency on the jboss.container.java.s2i module.
We can't depend on jboss.container.java.s2i module that implements the s2i logic, WildFly has its own different s2i logic.
We need the core to be clean from java.s2i specifics.

source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core"

# initialization of maven s2i module
function maven_s2i_init() {
Expand Down Expand Up @@ -80,11 +80,6 @@ function maven_s2i_maven_build() {
# copy build output to deployments folder
# internal method
function maven_s2i_deploy_artifacts() {
if [ -n "$(type -t maven_s2i_deploy_artifacts_override)" ]; then
eval maven_s2i_deploy_artifacts_override $*
return $?
fi

local artifact_dirs=${1:-${MAVEN_S2I_ARTIFACT_DIRS}}

if [[ ! "${S2I_SOURCE_DIR}" =~ ^\/ ]]; then
Expand Down
1 change: 0 additions & 1 deletion modules/maven/s2i/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ execute:
modules:
install:
- name: jboss.container.user
- name: jboss.container.s2i.core
- name: jboss.container.maven.default
- name: jboss.container.util.logging

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source "${JBOSS_CONTAINER_UTIL_LOGGING_MODULE}/logging.sh"
source "${JBOSS_CONTAINER_S2I_CORE_MODULE}/s2i-core"
source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core"

# inject our overridden maven_*() functions
function maven_s2i_source_maven_overrides() {
Expand Down Expand Up @@ -33,9 +33,3 @@ function maven_s2i_custom_binary_build() {

recursive_copy_files "${binary_dir}" "${S2I_TARGET_DEPLOYMENTS_DIR}"
}

function maven_s2i_deploy_artifacts_override() {
unset -f maven_s2i_deploy_artifacts_override
eval maven_s2i_deploy_artifacts $*
return $?
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function s2i_core_init() {
}

function s2i_core_env_init() {
# initialize core s2i environmet variables
s2i_core_env_init_hook
# initialize core s2i environment variables
S2I_TARGET_DATA_DIR="${S2I_TARGET_DATA_DIR:-${JAVA_DATA_DIR:-/deployments/data}}"
S2I_DESTINATION_DIR="${S2I_DESTINATION_DIR:-/tmp}"
S2I_ARTIFACTS_DIR="${S2I_DESTINATION_DIR}/artifacts"
S2I_SOURCE_DIR="${S2I_DESTINATION_DIR}/src"
Expand All @@ -35,12 +35,6 @@ function s2i_core_env_init() {
S2I_DELETE_SOURCE="${S2I_DELETE_SOURCE:-true}"
}

# extensions may override this method to initialize environment variables
# to suit their own needs.
function s2i_core_env_init_hook() {
:
}

# Copy files from a source path to a destination path
# Do not attempt to change metadata of the destination path, which we
# may not own
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ set -e
source "${JBOSS_CONTAINER_UTIL_LOGGING_MODULE}/logging.sh"
source "${JBOSS_CONTAINER_MAVEN_S2I_MODULE}/maven-s2i"

# include our s2i_core_*() overrides/extensions
source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core-hooks"

# inject our overridden maven_s2i_*() functions
source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/maven-s2i-overrides"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
args="$*"

source "${JBOSS_CONTAINER_UTIL_LOGGING_MODULE}/logging.sh"
source "${JBOSS_CONTAINER_S2I_CORE_MODULE}/s2i-core"
# include our s2i_core_*() overrides/extensions
source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core-hooks"
source "${JBOSS_CONTAINER_JAVA_S2I_MODULE}/s2i-core"

# Global S2I variable setup
s2i_core_env_init
Expand Down
File renamed without changes.

This file was deleted.

23 changes: 0 additions & 23 deletions modules/s2i/bash/module.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions modules/s2i/bash/configure.sh → modules/s2i/configure.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
install -D ${ARTIFACTS_DIR}/usr/libexec/s2i/* /usr/libexec/s2i
install -m 0644 -D -t /opt/jboss/container/java/s2i \
${ARTIFACTS_DIR}/opt/jboss/container/java/s2i/*

install -m 0644 -D {${ARTIFACTS_DIR},}/opt/jboss/container/java/s2i/s2i-core

mkdir -p /deployments \
&& chmod -R "ug+rwX" /deployments \
&& chown -R $USER:root /deployments
15 changes: 0 additions & 15 deletions modules/s2i/core/configure.sh

This file was deleted.

43 changes: 22 additions & 21 deletions modules/s2i/core/module.yaml → modules/s2i/module.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
schema_version: 1
name: jboss.container.s2i.core
version: '9.0'
description: "Provides support for core s2i capabilities."
name: jboss.container.java.s2i
version: '1.0'
description: Customization of common Maven S2I for Java S2I image.

execute:
- script: configure.sh
modules:
install:
- name: jboss.container.user
- name: jboss.container.maven.s2i
- name: jboss.container.java.run
- name: jboss.container.util.logging

packages:
install:
- findutils
- rsync

labels:
# XXX this modules does not install files in this path
- name: "io.openshift.s2i.scripts-url"
value: "image:///usr/libexec/s2i"
- name: io.openshift.s2i.destination
value: "/tmp"
- name: org.jboss.container.deployments-dir
value: "/deployments"

envs:
- name: JBOSS_CONTAINER_S2I_CORE_MODULE
value: /opt/jboss/container/s2i/core/
- name: JBOSS_CONTAINER_JAVA_S2I_MODULE
value: /opt/jboss/container/java/s2i

- name: S2I_DESTINATION_DIR
description: ^
Expand Down Expand Up @@ -113,11 +108,17 @@ envs:
Delete source files at the end of build. Defaults to true.
example: "false"

labels:
- name: "io.openshift.s2i.scripts-url"
value: "image:///usr/libexec/s2i"
- name: io.openshift.s2i.destination
value: "/tmp"
- name: org.jboss.container.deployments-dir
value: "/deployments"

execute:
- script: configure.sh

run:
cmd:
# XXX this script is in a different module
- "/usr/libexec/s2i/run"

modules:
install:
- name: jboss.container.user
2 changes: 1 addition & 1 deletion ubi10-openjdk-21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ modules:
version: "21"
- name: jboss.container.maven
version: "3.9.21"
- name: jboss.container.java.s2i.bash
- name: jboss.container.java.s2i

help:
add: true
Expand Down
Loading