Skip to content

Commit 75cca5f

Browse files
author
Jan Lieskovsky
committed
[RHSSO-1874] Fix the one-off JBoss CLI patch application mechanism
Split the actions currently performed by the 'eap' module, namely: * Provision (setup) of the base EAP layer, and * Possibility to apply EAP one-off patches in two subsequent modules. This will allow: 1) To apply traditional one-off patches via jboss-cli.sh: The patches won't need to follow the new Galleon patch format, intended to be used at the moment of EAP slim server provisioning via Galleon Maven distribution build. 2) To apply patches against both the EAP & RH-SSO layers: The patches being applied only later (once the 'keycloak' layer already is defined in the container image) enables to apply not only one-offs for the JBoss EAP server, but also for the RH-SSO server Signed-off-by: Jan Lieskovsky <[email protected]>
1 parent ca26ae6 commit 75cca5f

File tree

5 files changed

+59
-46
lines changed

5 files changed

+59
-46
lines changed

image.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,29 @@ modules:
9494
path: modules
9595

9696
install:
97-
# Define RH-SSO global variables & functions required by subsequent image modules.
97+
98+
# First define RH-SSO global variables & functions required by subsequent modules
9899
#
99-
# IMPORTANT: This module needs to be included (sourced) in each of the following
100-
# modules using "sed -e" or "sed -i" expressions, where the regex pattern
101-
# or the replacement value is dynamic (coming from env var supplied to the
102-
# container image at runtime). See CIAM-1394 JIRA for details
100+
# IMPORTANT: Include this module in each of the subsequent modules using some variable
101+
# or function definition from it
103102
- name: sso.rcfile
104103
version: '1.0'
104+
105+
# Setup nss_wrapper
105106
- name: sso.security.cve-2020-10695
106107
version: '1.0'
108+
107109
# Install JDK runtime
108110
- name: sso-jdk
109111
version: &jdk_version '11'
110-
# Perform all actions required by Wildfly / JBoss EAP Galleon Maven build
111-
# See 'used-eap-modules-list.txt' for overview of used JBoss EAP modules,
112-
# and the order they need to be called in
112+
113+
# Perform all actions required by Wildfly / JBoss EAP Galleon Maven build
114+
# See 'used-eap-modules-list.txt' for overview of used JBoss EAP modules,
115+
# and the order they need to be called in
113116
- name: eap
114117
version: '1.0'
115118

116-
## RH-SSO product specific modules from modules/ path in this repository
119+
# RH-SSO product specific modules from modules/ path in this repository
117120
- name: keycloak.openshift.clients
118121
version: '1.0'
119122
- name: sso.config.launch.setup.75
@@ -124,6 +127,12 @@ modules:
124127
- name: openshift-layer
125128
- name: keycloak-layer
126129

130+
# Apply any possibly needed EAP / RH-SSO patches
131+
# Note: In order to properly manage also RH-SSO patches, this module
132+
# can only be called once the 'keycloak' layer was added
133+
- name: sso.apply.patches
134+
version: '1.0'
135+
127136
# The extensions module can be called only after all updates to standalone-openshift.xml have been done.
128137
# See eg. https://access.redhat.com/solutions/3402171 for details how to use
129138
- name: sso-cli-extensions

modules/eap/install-eap-one-offs.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

modules/eap/module.yaml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
schema_version: 1
22
name: eap
3-
description: "Installs base EAP to the image."
3+
version: '1.0'
4+
description: Module to install base EAP layer to the RH-SSO container image
45

56
# NOTE:
7+
#
68
# The former listing of all specific EAP modules to be included into the RH-SSO
79
# images was replaced with a single 'setup.eap.modules' CEKit module (therefore
810
# one new layer in the resulting built container image).
@@ -20,6 +22,7 @@ description: "Installs base EAP to the image."
2022
# failed as a whole.
2123
#
2224
# IMPORTANT:
25+
#
2326
# Do not change this approach!
2427
#
2528
# If you need to add / list additional EAP module, not present yet, append the
@@ -36,30 +39,7 @@ description: "Installs base EAP to the image."
3639
# the starting and ending comments, so the order in which the modules need
3740
# to be included, is preserved and respected.
3841

39-
version: '1.0'
40-
4142
modules:
4243
install:
4344
- name: setup.eap.modules
4445
version: "1.0"
45-
46-
execute:
47-
- script: install-eap-one-offs.sh
48-
49-
# Important:
50-
# ----------
51-
#
52-
# All EAP one-offs artifacts must be prefixed with "eap-one-off-" prefix and suffixed with in ".zip".
53-
# Ensure that only one-offs for the INSTALLED version of EAP are present, and comment all of them
54-
# that are obsoleted.
55-
#
56-
# For an example of proper / intended usage, see the "jbeap-18807.zip" example below.
57-
#
58-
# artifacts:
59-
#
60-
# KEYCLOAK-13487 "jbeap-18807.zip" is obsolete in EAP-7.3.1 / RH-SSO 7.5.1, deprecate it
61-
#
62-
# - md5: 1b6036cfcde2cf1dc05c2eb6eca228ff
63-
# name: jbeap-18807.zip
64-
# target: eap-one-off-jbeap-18807.zip
65-
# url: http://$DOWNLOAD_SERVER/devel/candidates/JBSSO/JBSSO-7.5.0.CR2/jbeap-18807.zip
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
readonly SOURCES_DIR="/tmp/artifacts/"
6+
export JAVA_OPTS="${JAVA_OPTS} -Dorg.wildfly.patching.jar.invalidation=true"
7+
8+
# Do not use for cycle, it would faile if no such files are found
9+
find "${SOURCES_DIR}" \( -name 'eap-one-off-*.zip' -o -name 'rh-sso-*.zip' \) | while read -r I; do
10+
echo "Applying patch: '$I' ..."
11+
"${JBOSS_HOME}"/bin/jboss-cli.sh --command="patch apply $I"
12+
done
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
schema_version: 1
2+
name: sso.apply.patches
3+
version: '1.0'
4+
description: Module to apply any possibly needed EAP / RH-SSO one-off patches via jboss-cli.sh
5+
execute:
6+
- script: apply-eap-rh-sso-one-off-patches.sh
7+
8+
# Note:
9+
#
10+
# All EAP one-offs artifacts must be prefixed with "eap-one-off-" prefix and suffixed with ".zip".
11+
# All RH-SSO patches must be prefixed with "rh-sso-" prefix and suffixed with ".zip".
12+
#
13+
# Ensure that only one-offs for the INSTALLED version of EAP / RH-SSO are present, and comment all
14+
# of them that are obsoleted.
15+
#
16+
# For an example of proper / intended usage, see the "jbeap-18807.zip" example below.
17+
#
18+
# artifacts:
19+
#
20+
# KEYCLOAK-13487 "jbeap-18807.zip" is obsolete in EAP-7.3.1 / RH-SSO 7.5.1, deprecate it
21+
#
22+
# - md5: 1b6036cfcde2cf1dc05c2eb6eca228ff
23+
# name: jbeap-18807.zip
24+
# target: eap-one-off-jbeap-18807.zip
25+
# url: http://$DOWNLOAD_SERVER/devel/candidates/JBSSO/JBSSO-7.5.0.CR2/jbeap-18807.zip

0 commit comments

Comments
 (0)