[java-idp-plugin-jetty] 03/05: Add jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettybase.sh

Codeberg noreply at shibboleth.net
Mon Dec 15 15:28:31 UTC 2025


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-idp-plugin-jetty.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-jetty/commit/49aa1be716207177f6888562e82f9f6b41012faa

commit 49aa1be716207177f6888562e82f9f6b41012faa
Author: premeau <premeau at noreply.codeberg.org>
AuthorDate: Thu Dec 11 15:22:06 2025 +0100

    Add jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettybase.sh
---
 .../shibboleth/idp/module/jetty/setjettybase.sh    | 67 ++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettybase.sh b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettybase.sh
new file mode 100644
index 0000000..64318ed
--- /dev/null
+++ b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettybase.sh
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+
+declare LOCATION
+declare IDP_HOME
+declare JETTY_HOME
+declare JETTY_BASE
+declare -a INSTALLED_BASES
+
+LOCATION=$(dirname $0)
+
+# Source our deployer stub.
+if [ -e $LOCATION/jettyenv.sh ] ; then
+  source $LOCATION/jettyenv.sh
+fi
+
+# If JETTY_HOME is defined at this point
+# symbolic links are likely not in use.
+if [ "${JETTY_BASE}" != "" ] ; then
+  echo "JETTY_BASE is already set in the evironment, exiting."
+  exit 1
+fi
+
+IDP_HOME=$(realpath ${LOCATION}/..)
+
+# Defaults
+JETTY_HOME=${JETTY_HOME:-$IDP_HOME/jetty-home}
+JETTY_BASE=${JETTY_BASE:-$IDP_HOME/jetty-base}
+
+INSTALLED_BASES=( $( find ${IDP_HOME} -type d -name "jetty-base-*" | sed -e 's/.*base-//' ) )
+
+if [ $# -eq 0 ] ; then
+  if [ "${#INSTALLED_BASES[@]}" -eq 0 ] ; then
+    # This should only happen if things are manually removed.
+    echo "There are no jetty-base versions available, unable to set version"
+    exit 1
+  elif [ "${#INSTALLED_BASES[@]}" -eq 1 ] ; then
+    TARGET_BASE_VER=${INSTALLED_BASE[0]}
+  elif [ "${#INSTALLED_BASES[@]}" -gt 1 ] ; then
+    echo ""
+    echo "Which Jetty Base version would you like to activate?"
+    echo ""
+    PS3="Your choice => "
+    select opt in "${INSTALLED_BASES[@]}"
+    do
+      TARGET_BASE_VER=$opt
+      break
+    done
+  fi
+else
+  TARGET_BASE_VER=$1
+fi
+
+if [ ! -d "${IDP_HOME}/jetty-base-${TARGET_BASE_VER}" ] ; then
+  echo Jetty Base Version ${TARGET_BASE_VER} not found, exiting.
+  exit 1
+fi
+
+CURRENT_BASE_VER=$(readlink -e ${IDP_HOME}/jetty-base | sed -e 's/.*-//')
+
+if [ "${CURRENT_BASE_VER}" == "${TARGET_BASE_VER}" ] ; then
+  echo "Jetty Base version ${CURRENT_BASE_VER} is already active."
+  exit 0
+fi
+
+echo -n "Activating Jetty Base Version ${TARGET_BASE_VER} ... "
+ln -snf jetty-base-${TARGET_BASE_VER} ${IDP_HOME}/jetty-base
+echo "Done."

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list