mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
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:
@@ -21,13 +21,12 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Sync JAR to deploy/
|
||||
if [[ -f "cw-elevator-application-starter/target/cw-elevator-application-2.0.7.jar" ]]; then
|
||||
cp cw-elevator-application-starter/target/cw-elevator-application-2.0.7.jar \
|
||||
deploy/v2-maven/cw-elevator-application-2.0.7.jar
|
||||
log_ok "JAR synced to deploy/v2-maven/"
|
||||
# Sync JAR to deploy/ — use wildcard to match any version
|
||||
LATEST_JAR=$(ls -t cw-elevator-application-starter/target/cw-elevator-application-*.jar 2>/dev/null | grep -v sources | head -1)
|
||||
if [[ -n "$LATEST_JAR" ]]; then
|
||||
cp "$LATEST_JAR" deploy/v2-maven/
|
||||
log_ok "JAR synced: $(basename "$LATEST_JAR") → deploy/v2-maven/"
|
||||
else
|
||||
# Fallback: use sync-jars.sh
|
||||
cd deploy && bash sync-jars.sh
|
||||
log_ok "JAR synced via sync-jars.sh"
|
||||
log_error "No JAR found in target/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -35,10 +35,10 @@ check_tcp "Kafka" "$KAFKA_HOST" "$KAFKA_PORT"
|
||||
check_http "Nginx" "http://$CONSUL_HOST:$PORT_NGINX"
|
||||
|
||||
log_info "--- Application Services ---"
|
||||
check_http "elevator-v2" "http://127.0.0.1:$PORT_ELEVATOR_V2/actuator/health"
|
||||
check_http "elevator-v1" "http://127.0.0.1:$PORT_ELEVATOR_V1/actuator/health"
|
||||
check_http "crk-std" "http://127.0.0.1:$PORT_CRK_MGMT/actuator/health"
|
||||
check_http "alarm-app" "http://127.0.0.1:$PORT_ALARM_MGMT/actuator/health"
|
||||
check_http "elevator-v2" "http://127.0.0.1:$PORT_ELEVATOR_V2/health"
|
||||
check_http "elevator-v1" "http://127.0.0.1:$PORT_ELEVATOR_V1/health"
|
||||
check_http "crk-std" "http://127.0.0.1:$PORT_CRK_MGMT/health"
|
||||
check_http "alarm-app" "http://127.0.0.1:$PORT_ALARM_MGMT/health"
|
||||
|
||||
log_info "--- Databases ---"
|
||||
check_tcp "MySQL" "$MYSQL_HOST" "$MYSQL_PORT"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user