Files
spring-boot-microservices-p…/cloud-2026-upgrade/scripts/run-all.sh
T

40 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Rebuilds everything and regenerates output/. Needs JDK 25 (21+ works for the shop), Maven 3.9+, curl, python3,
# openssl and patch. Ports 8081-8083, 8080, 8090-8095, 8761, 8888 and 9091 must be free.
# Extra Maven arguments (for example a settings file) go in MVN_ARGS.
set -uo pipefail
cd "$(dirname "$0")/.."
build() { (cd "$1" && mvn -B -q -DskipTests package ${MVN_ARGS:-}) || exit 1; }
M=${MAVEN_REPO:-https://repo1.maven.org/maven2}
W=${RUN_WRAPPER:-} # optional command put in front of every script that starts servers
echo "== version facts"
MAVEN_REPO=$M python3 -I scripts/bom-diff.py 2025.1.5 2026.0.0 > output/01-bom-diff.txt
MAVEN_REPO=$M python3 -I scripts/props-diff.py > output/02-properties-diff.txt
echo "== the shop, step by step"
scripts/upgrade.sh 0 0 && scripts/upgrade.sh 1 1 && scripts/upgrade.sh 2 2 && scripts/upgrade.sh 4 4 && scripts/upgrade.sh 5 5
scripts/upgrade.sh 1 bootonly && sed -i '0,/<version>4.1.3<\/version>/s//<version>4.2.0<\/version>/' run/shopbootonly/pom.xml
scripts/upgrade.sh 1 cloudonly && sed -i 's/<spring-cloud.version>2025.1.5</<spring-cloud.version>2026.0.0</' run/shopcloudonly/pom.xml
for s in 0 1 2 4 5 bootonly cloudonly; do build run/shop$s; done
scripts/upgrade.sh 4 norc
python3 -I - <<'P'
p='run/shopnorc/config-server/pom.xml'; s=open(p).read()
i=s.index('<!-- ... and a RestClient.Builder bean -->'); j=s.index('</dependency>',i)+len('</dependency>'); open(p,'w').write(s[:i]+s[j:])
P
build run/shopnorc
$W scripts/half-upgrades.sh
for s in 1 2 5; do $W scripts/shop-scenarios.sh "$PWD/run/shop$s"; done
scripts/collect-shop.sh
scripts/dependency-diff.sh
$W scripts/config-notify.sh "$PWD/run/shop4" 40-config-notify-record.txt
$W scripts/config-notify.sh "$PWD/run/shop5" 41-config-notify-class.txt
$W scripts/notify-without-restclient.sh "$PWD/run/shopnorc"
$W scripts/native-labels.sh "$PWD/run/shop1" "$PWD/run/shop2"
echo "== probes"
scripts/probe-gateway.sh --build && $W scripts/probe-gateway.sh
$W scripts/shop-trusted-proxies.sh "$PWD/run/shop5"
scripts/probe-libs.sh
scripts/preview-demos.sh