ci: parse smoke response as json

This commit is contained in:
2026-08-21 23:30:59 +08:00
parent 5fbf159369
commit 011ef82cd0
+5 -1
View File
@@ -181,7 +181,11 @@ pipeline {
$DOCKER_CMD logs "$SMOKE_APP" >&2
exit 1
fi
grep -Fq "\"version\":\"$IMMUTABLE_TAG\"" artifacts/smoke-ping.json
python3 - "$IMMUTABLE_TAG" <<'PY'
import json, pathlib, sys
payload = json.loads(pathlib.Path('artifacts/smoke-ping.json').read_text(encoding='utf-8'))
assert payload.get('version') == sys.argv[1], payload
PY
curl --fail --silent --show-error "http://127.0.0.1:$host_port/" \
| grep -Fq '<div id="app"></div>'
'''