11 lines
546 B
Bash
Executable File
11 lines
546 B
Bash
Executable File
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
# shellcheck disable=SC1091
|
||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh"
|
||
|
||
origin="http://127.0.0.1:$ELDER_SERVER_PORT"
|
||
health="$(curl --fail --silent --show-error --max-time 10 "$origin/actuator/health")"
|
||
grep -q '"status":"UP"' <<< "$health" || { echo "健康检查未返回 UP:$health" >&2; exit 1; }
|
||
curl --fail --silent --show-error --max-time 10 -o /dev/null "$origin/doc.html"
|
||
echo "后端健康检查通过,接口文档可访问:http://127.0.0.1:$ELDER_SERVER_PORT/doc.html"
|