45 lines
1.5 KiB
PowerShell
45 lines
1.5 KiB
PowerShell
# 发布后验收:端口、健康、现网未误停
|
|
$ErrorActionPreference = 'Continue'
|
|
Write-Output '=== ports ==='
|
|
foreach ($x in 8080, 8810, 8813, 8180, 8910, 8913) {
|
|
$c = Get-NetTCPConnection -LocalPort $x -State Listen -EA SilentlyContinue | Select-Object -First 1
|
|
if ($c) { Write-Output "$x LISTEN pid=$($c.OwningProcess)" } else { Write-Output "$x down" }
|
|
}
|
|
|
|
Write-Output '=== health ==='
|
|
foreach ($u in @(
|
|
'http://127.0.0.1:8910/health',
|
|
'http://127.0.0.1:8180/jeecgboot/',
|
|
'http://127.0.0.1:8180/jeecgboot/sys/randomImage/deploycheck',
|
|
'http://127.0.0.1:8080/jeecg-boot/'
|
|
)) {
|
|
try {
|
|
$r = Invoke-WebRequest -Uri $u -UseBasicParsing -TimeoutSec 8
|
|
Write-Output ("OK " + $r.StatusCode + " " + $u)
|
|
} catch {
|
|
$code = $null
|
|
try { $code = $_.Exception.Response.StatusCode.value__ } catch {}
|
|
Write-Output ("FAIL " + $u + " code=" + $code)
|
|
}
|
|
}
|
|
|
|
Write-Output '=== worker ==='
|
|
$found = $false
|
|
Get-CimInstance Win32_Process | ForEach-Object {
|
|
if ($_.CommandLine -and $_.CommandLine -like '*worker_app*' -and $_.CommandLine -like '*wwwroot*agent*') {
|
|
Write-Output ("worker pid=" + $_.ProcessId)
|
|
$found = $true
|
|
}
|
|
}
|
|
if (-not $found) { Write-Output 'worker NOT found' }
|
|
|
|
Write-Output '=== pointer ==='
|
|
Get-Content 'E:\wwwroot\ops\active-release.json' -Raw
|
|
|
|
Write-Output '=== yutongda pointer untouched ==='
|
|
if (Test-Path 'C:\yutongda\ops\active-release.json') {
|
|
Write-Output 'C:\yutongda\ops\active-release.json still exists (not deleted)'
|
|
}
|
|
|
|
Write-Output 'ACCEPT_DONE'
|