修复生产新初版部署状态

This commit is contained in:
2026-07-07 16:46:36 +08:00
parent 2d19ecb411
commit 0ff68d9408
5 changed files with 68 additions and 18 deletions
+24 -8
View File
@@ -20,12 +20,15 @@
[string]$GatewayPattern = "^JY-Gateway",
[string]$WebTargetName = "",
[string]$WebTargetHost = "8.137.35.61",
[string]$CoreRemoteAppDir = "/opt/jy-core",
[string]$GatewayRemoteAppDir = "/opt/jy-gateway",
[string]$CoreRemoteAppDir = "/opt/jayu-cloud/core",
[string]$GatewayRemoteAppDir = "/opt/jayu-cloud/gateway",
[string]$WebRemoteDir = "/opt/jy-artist-frontend",
[string]$CoreServiceName = "jy-core",
[string]$GatewayServiceName = "jy-gateway",
[int]$CoreHealthPort = 81,
[string]$CoreServiceName = "jayu-cloud-core",
[string]$GatewayServiceName = "jayu-cloud-gateway",
[string]$LegacyBackendAppDir = "/opt/app",
[string]$LegacyCoreServiceName = "yuminail-core",
[string]$LegacyGatewayServiceName = "yuminail-gateway",
[int]$CoreHealthPort = 80,
[int]$GatewayHealthPort = 80,
[string]$HealthPath = "/health/check",
[int]$HealthTimeoutSeconds = 120,
@@ -637,11 +640,15 @@ fi
if [ -f "`$APP_DIR/app.pid" ]; then
kill "`$(cat "`$APP_DIR/app.pid")" >/dev/null 2>&1 || true
fi
pkill -f "java .*`$APP_DIR/.*\.jar" >/dev/null 2>&1 || true
pids="`$(ps -eo pid=,comm=,args= | awk -v app_dir="`$APP_DIR" '`$2 == "java" && index(`$0, app_dir "/") && `$0 ~ /\.jar/ {print `$1}')"
if [ -n "`$pids" ]; then
kill `$pids >/dev/null 2>&1 || true
fi
sleep 2
if pgrep -f "java .*`$APP_DIR/.*\.jar" >/dev/null 2>&1; then
remaining_processes="`$(ps -eo pid=,comm=,args= | awk -v app_dir="`$APP_DIR" '`$2 == "java" && index(`$0, app_dir "/") && `$0 ~ /\.jar/ {print}')"
if [ -n "`$remaining_processes" ]; then
echo "Backend process still running under `$APP_DIR"
pgrep -af "java .*`$APP_DIR/.*\.jar" || true
printf '%s\n' "`$remaining_processes"
exit 62
fi
"@
@@ -872,6 +879,11 @@ function Write-ReleaseManifest {
serverInfoPath = $ResolvedServerInfoPath
coreRemoteAppDir = $CoreRemoteAppDir
gatewayRemoteAppDir = $GatewayRemoteAppDir
coreServiceName = $CoreServiceName
gatewayServiceName = $GatewayServiceName
legacyBackendAppDir = $LegacyBackendAppDir
legacyCoreServiceName = $LegacyCoreServiceName
legacyGatewayServiceName = $LegacyGatewayServiceName
webRemoteDir = $WebRemoteDir
publicBaseUrl = $PublicBaseUrl
managerMobileWeb = "$PublicBaseUrl/jy-salon-front/"
@@ -959,9 +971,13 @@ if (-not $Deploy) {
if ($ResetDatabase -or $ClearOldBackendJars) {
Stop-BackendGroup "Core" $coreServers $CoreRemoteAppDir $CoreServiceName
Stop-BackendGroup "Gateway" $gatewayServers $GatewayRemoteAppDir $GatewayServiceName
Stop-BackendGroup "Legacy Core" $coreServers $LegacyBackendAppDir $LegacyCoreServiceName
Stop-BackendGroup "Legacy Gateway" $gatewayServers $LegacyBackendAppDir $LegacyGatewayServiceName
}
if ($ClearOldBackendJars) {
Clear-BackendJarGroup "Legacy Core" $coreServers $LegacyBackendAppDir
Clear-BackendJarGroup "Legacy Gateway" $gatewayServers $LegacyBackendAppDir
Clear-BackendJarGroup "Core" $coreServers $CoreRemoteAppDir
Clear-BackendJarGroup "Gateway" $gatewayServers $GatewayRemoteAppDir
}