elder-yudao-pro/deploy/local/check.sh

11 lines
546 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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"