mirror of
https://github.com/kellymichels/zscripts-token-savers
synced 2026-10-07 07:18:18 +00:00
fix(zdeploy): truncate the health-check body in the PASS line
Pointing the nextjs handler at Test-DeployHealth means the body is now often an HTML page, not a line of JSON, so the PASS line dumped ~10 KB of markup into the deploy output and buried everything after it. Match on the full body as before, but print at most 200 characters plus the byte count. A /health endpoint still prints in full.
This commit is contained in:
parent
27fad897a0
commit
5534266311
@ -8,7 +8,7 @@ c336a61cb8563736bd6550671d7dc90b14702a43f25a97b1ac15ffd64605fbf6 zbackup_ec2.cm
|
||||
20e6282901a919aa32ea717c739ba2dc9657426dff860f0e5fce201edefd99da zchecksums.cmd
|
||||
692b7b0ff9e51e5d9b880358b33c54d2db4f967297a5350e154df1ce6f06ebc6 zchecksums.ps1
|
||||
b56085112e7c573926a70a58872163b71416d58ce91ea7114b1f5de5fc96c982 zdeploy.cmd
|
||||
df80a078ae1869626834245b7a1b9450ddf543fcb7cf78ba5d2dd04ae3bdf577 zdeploy.ps1
|
||||
c4189cef72368487af4524a00603967d7c8dc03c58ace5d4dd1e264ce1d22bd9 zdeploy.ps1
|
||||
fa817d3bd7bba98b03b411d3c5a82b210d3cca316ac0c9785afa5b4ac5fe0766 zec2.cmd
|
||||
5f70432af23df3459a98d9ad6a0da723783f2269dd5f5ab8ecdd6366ebc84942 zec2.ps1
|
||||
4df94eda29b6f5b2cb6bfa63e0add4d90ea24d936305f36a69988e8dd5d69154 zec2_rotatekeys.cmd
|
||||
|
||||
@ -270,7 +270,11 @@ function Test-DeployHealth {
|
||||
$body = ($raw | Out-String).Trim()
|
||||
if ($LASTEXITCODE -eq 0 -and $body) {
|
||||
if (-not $expect -or $body.Contains($expect)) {
|
||||
Write-Host " PASS - $body" -ForegroundColor Green
|
||||
# A /health endpoint returns a line of JSON; an app page returns
|
||||
# kilobytes of HTML. Match on the whole body, but only print
|
||||
# enough to recognise it — the rest is unreadable in a log.
|
||||
$shown = if ($body.Length -gt 200) { $body.Substring(0, 200) + "... ($($body.Length) bytes)" } else { $body }
|
||||
Write-Host " PASS - $shown" -ForegroundColor Green
|
||||
return $true
|
||||
}
|
||||
Write-Host " Responding but '$expect' not found - waiting..." -ForegroundColor DarkYellow
|
||||
|
||||
Loading…
Reference in New Issue
Block a user