Skip to content

Commit 8f4cb4f

Browse files
committed
Add demo for new Spring Boot Upgrade report
1 parent 5485956 commit 8f4cb4f

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
demo-spring-song-app
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/sh
2+
3+
scriptDir=$(dirname "${BASH_SOURCE[0]}")
4+
projectRoot=$scriptDir/../..
5+
webApp=$projectRoot/applications/spring-boot-upgrade
6+
demoApp="$scriptDir/demo-spring-song-app"
7+
applicationJar="${webApp}/target/spring-boot-upgrade.jar"
8+
9+
function pause(){
10+
echo "=============================================================================================="
11+
echo " -> $*"
12+
echo " Press Enter to continue..."
13+
read -p "=============================================================================================="
14+
}
15+
16+
function build() {
17+
# build sbm
18+
pushd "${projectRoot}" || exit
19+
mvn clean install -DskipTests
20+
popd
21+
}
22+
23+
function buildIfGitStatusNotClean() {
24+
git update-index --really-refresh >> /dev/null
25+
if [[ ! `git diff-index --quiet HEAD` ]] || [[ ! -f "${webApp}/target/spring-boot-upgrade.jar" ]]; then
26+
echo "git status not clean, building project"
27+
build
28+
fi
29+
}
30+
31+
32+
# cleanup
33+
rm -rf "$demoApp"
34+
35+
buildIfGitStatusNotClean
36+
37+
# checkout demo project
38+
git clone https://github.com/sanagaraj-pivotal/demo-spring-song-app.git $demoApp
39+
pushd "$demoApp" || exit
40+
git checkout -b boot-3-upgrade-demo tags/demo
41+
idea .
42+
popd
43+
44+
pause "kill process currently running under port 8080"
45+
lsof -i :8080 | awk '{system("kill -9 " $2)}'
46+
47+
# start webapp
48+
java -jar --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED $applicationJar $demoApp

0 commit comments

Comments
 (0)