Skip to content

Commit 9563501

Browse files
committed
support CDS
1 parent 6fd74e0 commit 9563501

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

app/src/main/resources/common/README.md.mustache

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,21 @@ Run the CAS web application as a *standalone* executable WAR:
125125
./gradlew[.bat] clean executable
126126
```
127127

128+
### CDS Support
129+
130+
CDS is a JVM feature that can help reduce the startup time and memory footprint of Java applications. CAS via Spring Boot
131+
now has support for easy creation of a CDS friendly layout. This layout can be created by extracting the CAS web application file
132+
with the help of the `tools` jarmode:
133+
134+
```bash
135+
# Note:
136+
# You must first build the web application with "executable" turned off
137+
java -Djarmode=tools -jar build/libs/{{appName}}.war extract
138+
139+
# Run the CAS web application via CDS
140+
java -jar {{appName}}/{{appName}}.war
141+
```
142+
128143
## External
129144

130145
Deploy the binary web application file in `build/libs` after a successful build to a servlet container of choice.

ci/validate-cas-overlay.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,26 @@ if [[ "$CAS_MAJOR_VERSION" -ge 7 ]]; then
212212
./gradlew --init-script openrewrite.gradle rewriteDryRun \
213213
-PtargetVersion="${targetVersion}" -DactiveRecipe="$recipeName"
214214
[ $? -eq 0 ] && echo "Gradle command ran successfully." || exit 1
215+
216+
if [[ "$CAS_MINOR_VERSION" -ge 1 ]]; then
217+
printgreen "Build CAS web application without executable mode..."
218+
./gradlew clean build -Pexecutable=false --no-daemon
219+
220+
printgreen "Extracting Uber WAR from CAS to prepare CDS launch..."
221+
java -Djarmode=tools -jar build/libs/cas.war extract
222+
java -jar ./cas/cas.war --spring.profiles.active=none --server.ssl.enabled=false --server.port=8091 &
223+
pid=$!
224+
sleep 15
225+
echo "Launched executable CAS with pid ${pid}. Waiting for CAS server to come online..."
226+
until curl -k -L --output /dev/null --silent --fail http://localhost:8091/cas/login; do
227+
echo -n '.'
228+
sleep 5
229+
done
230+
echo -e "\n\nReady!"
231+
echo "Killing process $pid"
232+
kill -9 $pid
233+
[ "$CI" = "true" ] && pkill java
234+
fi
215235
fi
216236

217237
[ "$CI" = "true" ] && pkill java

0 commit comments

Comments
 (0)