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

Codeberg noreply at shibboleth.net
Mon Dec 15 15:28:29 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/8abbe0a9bfad1391e1168e1632c58dd83aec4014

commit 8abbe0a9bfad1391e1168e1632c58dd83aec4014
Author: premeau <premeau at noreply.codeberg.org>
AuthorDate: Wed Dec 10 18:46:52 2025 +0100

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

diff --git a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettyversion.sh b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettyversion.sh
new file mode 100644
index 0000000..7351bc6
--- /dev/null
+++ b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/setjettyversion.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+
+declare LOCATION
+declare IDP_HOME
+declare JETTY_HOME
+declare JETTY_BASE
+declare -a INSTALLED_JETTYS
+
+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_HOME}" != "" ] ; then
+  echo "JETTY_HOME 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_JETTYS=( $( find ${IDP_HOME} -type d -name "jetty-home-*" | sed -e 's/.*home-//' ) )
+
+if [ $# -eq 0 ] ; then
+  if [ "${#INSTALLED_JETTYS[@]}" -eq 0 ] ; then
+    echo "Jetty has not been downloaded, unable to set version"
+    exit 1
+  elif [ "${#INSTALLED_JETTYS[@]}" -eq 1 ] ; then
+    TARGET_JETTY_VER=${INSTALLED_JETTYS[0]}
+  elif [ "${#INSTALLED_JETTYS[@]}" -gt 1 ] ; then
+    echo ""
+    echo "Which Jetty version would you like to activate?"
+    echo ""
+    PS3="Your choice => "
+    select opt in "${INSTALLED_JETTYS[@]}"
+    do
+      TARGET_JETTY_VER=$opt
+      break
+    done
+  fi
+else
+  TARGET_JETTY_VER=$1
+fi
+
+if [ ! -d "${IDP_HOME}/jetty-dist/jetty-home-${TARGET_JETTY_VER}" ] ; then
+  echo Jetty Version ${TARGET_JETTY_VER} not found, exiting.
+fi
+
+CURRENT_JETTY_VER=$(readlink -e ${IDP_HOME}/jetty-home | sed -e 's/.*-//')
+
+if [ "${CURRENT_JETTY_VER}" == "${TARGET_JETTY_VER}" ] ; then
+  echo "Jetty version ${CURRENT_JETTY_VER} is already active."
+  exit 0
+fi
+
+echo -n "Activating Jetty Version ${TARGET_JETTY_VER} ... "
+ln -snf jetty-dist/jetty-home-${TARGET_JETTY_VER} ${IDP_HOME}/jetty-home
+echo "Done."

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


More information about the commits mailing list