From a595d9a1816e0be4a8a1494dc4919bd31f04d61d Mon Sep 17 00:00:00 2001 From: Spolti Date: Mon, 26 Apr 2021 16:36:37 -0300 Subject: [PATCH] [RHPAM-2855] - Broken symlink in registry.redhat.io/rhpam-7/rhpam-kieserver-rhel8 image (#397) Signed-off-by: spolti --- jboss/container/maven/default/backward_compatibility.sh | 9 ++++++--- jboss/container/maven/default/configure.sh | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/jboss/container/maven/default/backward_compatibility.sh b/jboss/container/maven/default/backward_compatibility.sh index 6e7433fb..23c31956 100755 --- a/jboss/container/maven/default/backward_compatibility.sh +++ b/jboss/container/maven/default/backward_compatibility.sh @@ -1,10 +1,13 @@ #!/bin/sh # Configure module set -e - # For backward compatibility mkdir -p /usr/local/s2i -ln -s /opt/jboss/container/maven/default/scl-enable-maven /usr/local/s2i/scl-enable-maven -chown -h jboss:root /usr/local/s2i/scl-enable-maven +# scl-enable-maven is not needed on ubi8 images. +if test -r "${JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE}/scl-enable-maven"; then + ln -s /opt/jboss/container/maven/default/scl-enable-maven /usr/local/s2i/scl-enable-maven + chown -h jboss:root /usr/local/s2i/scl-enable-maven +fi + ln -s /opt/jboss/container/maven/default/maven.sh /usr/local/s2i/common.sh chown -h jboss:root /usr/local/s2i/common.sh diff --git a/jboss/container/maven/default/configure.sh b/jboss/container/maven/default/configure.sh index afc29f8f..0ec803d3 100755 --- a/jboss/container/maven/default/configure.sh +++ b/jboss/container/maven/default/configure.sh @@ -18,7 +18,11 @@ popd MAVEN_VERSION_SQUASHED=${MAVEN_VERSION/./} # pull in specific maven version to serve as default -ln -s /opt/jboss/container/maven/${MAVEN_VERSION_SQUASHED}/* /opt/jboss/container/maven/default +for f in /opt/jboss/container/maven/${MAVEN_VERSION_SQUASHED}/*; do + if test -f "$f"; then + ln -s "$f" /opt/jboss/container/maven/default; + fi; +done chown -h jboss:root /opt/jboss/container/maven/default/* # install default settings.xml file in user home