[java-idp-jetty-base] 08/09: IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
Rod Widdowson
rdw at steadingsoftware.com
Sat Aug 10 15:04:36 UTC 2024
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch dev/IDP-2297
in repository java-idp-jetty-base.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-jetty-base.git;a=commit;h=c8e9e7987798f0eec92bb78555835c8648e015e1
commit c8e9e7987798f0eec92bb78555835c8648e015e1
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Aug 10 14:04:55 2024 +0100
IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
https://shibboleth.atlassian.net/browse/IDP-2297
Script file to run the IDP From the command line for windows and unix
---
.../idp/plugin/jettybase/module.properties | 12 ++++++
.../idp/plugin/jettybase/module/runjetty.bat | 45 ++++++++++++++++++++
.../idp/plugin/jettybase/module/runjetty.sh | 49 ++++++++++++++++++++++
3 files changed, 106 insertions(+)
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties
index db9472f..8d3cd7f 100644
--- a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module.properties
@@ -54,3 +54,15 @@ jetty.base.module.10.nonwindows = false
jetty.base.module.10.windows = true
jetty.base.module.10.replace = false
+jetty.base.module.11.src = /net/shibboleth/idp/plugin/jettybase/module/runjetty.bat
+jetty.base.module.11.dest = bin/runjetty.bat
+jetty.base.module.11.nonwindows = false
+jetty.base.module.11.windows = true
+
+jetty.base.module.12.src = /net/shibboleth/idp/plugin/jettybase/module/runjetty.sh
+jetty.base.module.12.dest = bin/runjetty.sh
+jetty.base.module.12.nonwindows = true
+jetty.base.module.12.windows = false
+jetty.base.module.12.exec = true
+
+
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat
new file mode 100644
index 0000000..99fd3dd
--- /dev/null
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.bat
@@ -0,0 +1,45 @@
+rem @echo off
+setlocal
+
+REM We need a JVM
+if not defined JAVA_HOME (
+ echo Error: JAVA_HOME is not defined.
+ exit /b
+)
+
+if not defined IDP_HOME (
+ echo Error: IDP_HOME is not defined.
+ exit /b
+)
+
+if not defined JAVACMD (
+ set JAVACMD="%JAVA_HOME%\bin\java.exe"
+)
+
+set IDP_HOME_WINDOWS=%~dp0..
+
+if not defined JETTY_HOME {
+ set JETTY_HOME=%IDP_HOME_WINDOWS%\jetty-home
+}
+
+if not defined JETTY_BASE {
+ set JETTY_BASE=%IDP_HOME_WINDOWS%\jetty-base
+}
+
+if not exist "%JETTY_HOME%\start.jar" (
+ echo Error: JETTY_HOME does not point to a valid Jetty Installation
+ exit /b
+)
+
+if not exist "%JETTY_BASE%\start.d" (
+ echo Error: JETTY_BASE does not point to a Jetty Base
+ exit /b
+)
+
+set JVM_ARGS=-Didp.home="%IDP_HOME%" -Djdk.tls.ephemeralDHKeySize=2048 -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog -Djava.io.tmpdir="%JETTY_BASE%/tmp" -XX:+UseG1GC
+
+SET JETTY_ARGS=jetty.base="%JETTY_BASE%" jetty.logging.dir="%JETTY_BASE%\logs"
+
+%JAVACMD% -jar "%JETTY_HOME%/start.jar" %JVM_ARGS% %JETTY_ARGS%
+
+
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.sh b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.sh
new file mode 100644
index 0000000..03e7f7b
--- /dev/null
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/runjetty.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+declare JAVACMD
+declare LOCATION
+declare IDP_HOME
+declare JETTY_HOME
+declare JETTY_BASE
+
+declare JVM_ARGS
+declare JETTY_ARGS
+
+LOCATION=$(dirname $0)
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ JAVACMD=$JAVA_HOME/bin/java
+ else
+ JAVACMD=$(which java)
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+IDP_HOME=$LOCATION/..
+
+JETTY_HOME=$LOCATION/../jetty-home
+if [ ! -e "$JETTY_HOME/start.jar" ] ; then
+ echo "Error: JETTY_HOME is not defined correctly."
+ echo " $JETTY_HOME/start.jar not found"
+ exit 1
+fi
+
+JETTY_BASE=$LOCATION/../jetty-base
+if [ ! -d "$JETTY_BASE/start.d" ] ; then
+ echo "Error: JETTY_BASE is not defined correctly."
+ echo " $JETTY_BASE/start.d not found"
+ exit 1
+fi
+
+JVM_ARGS="-Didp.home=$IDP_HOME -Djdk.tls.ephemeralDHKeySize=2048 -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog -Djava.io.tmpdir=$JETTY_BASE/tmp -XX:+UseG1GC"
+
+JETTY_ARGS="jetty.base=$JETTY_BASE jetty.logging.dir=$JETTY_BASE/logs"
+
+$JAVACMD '-jar' $JETTY_HOME/start.jar $JVM_ARGS $JETTY_ARGS
+
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list