fix: use wildcard JAR matching for any version, fix health endpoints to /health (Boot 1.x)

Former-commit-id: 20071a784e3c5c1f8b392fd5ec8d44b500810359
This commit is contained in:
反编译工作区
2026-05-01 23:18:31 +08:00
parent 31ec44e21a
commit 7a7bf42165
3 changed files with 21 additions and 18 deletions
+10 -6
View File
@@ -29,7 +29,7 @@ start_service() {
# 等待服务就绪 (最多 60s)
for i in $(seq 1 30); do
sleep 2
if curl -sf "http://127.0.0.1:$port/actuator/health" &>/dev/null; then
if curl -sf "http://127.0.0.1:$port/health" &>/dev/null; then
log_ok " $name (pid=$pid, port=$port) STARTED"
return 0
fi
@@ -68,16 +68,20 @@ if [[ -f "$ALARM_JAR" ]]; then
start_service "alarm-app" "$ALARM_JAR" "$PORT_ALARM" "$JAVA_OPTS_HEAVY" --spring.config.location="$STAR_CENTER/ninca_qk_alarm_app_01-ninca_qk_alarm_app/"
fi
# A12: elevator V2 (最后启动)
ELEVATOR_V2_JAR="$REPO_ROOT/maven-cw-elevator-application/deploy/v2-maven/cw-elevator-application-2.0.7.jar"
if [[ -f "$ELEVATOR_V2_JAR" ]]; then
# A12: elevator V2 (最后启动) — use wildcard to match any version
ELEVATOR_V2_JAR=$(ls -t "$REPO_ROOT/maven-cw-elevator-application/deploy/v2-maven/cw-elevator-application-"*.jar 2>/dev/null | head -1)
if [[ -n "$ELEVATOR_V2_JAR" ]]; then
start_service "elevator-v2" "$ELEVATOR_V2_JAR" "$PORT_ELEVATOR_V2" "$JAVA_OPTS_HEAVY" --spring.config.location="$REPO_ROOT/maven-cw-elevator-application/deploy/v2-maven/"
else
log_warn "No elevator V2 JAR found in deploy/v2-maven/"
fi
# A13: elevator V1 (对拍对照)
ELEVATOR_V1_JAR="$REPO_ROOT/maven-cw-elevator-application/deploy/v1-legacy/cw-elevator-application-V1.0.0.20211103.jar"
if [[ -f "$ELEVATOR_V1_JAR" ]]; then
ELEVATOR_V1_JAR=$(ls -t "$REPO_ROOT/maven-cw-elevator-application/deploy/v1-legacy/cw-elevator-application-"*.jar 2>/dev/null | head -1)
if [[ -n "$ELEVATOR_V1_JAR" ]]; then
start_service "elevator-v1" "$ELEVATOR_V1_JAR" "$PORT_ELEVATOR_V1" "$JAVA_OPTS_HEAVY" --spring.config.location="$REPO_ROOT/maven-cw-elevator-application/deploy/v1-legacy/"
else
log_warn "No elevator V1 JAR found in deploy/v1-legacy/"
fi
log_info "All services started"