fix: use docker exec for MySQL check in CI script
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 2m25s

mysqladmin may not be in CI runner PATH. Use docker exec mysql
mysqladmin ping instead, which works from the Gitea Actions runner.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-19 22:53:47 +08:00
parent eef42d51ab
commit 563675f6ef

View File

@ -10,10 +10,10 @@ REDIS_H="${REDIS_HOST:-127.0.0.1}"
REDIS_P="${REDIS_PORT:-6379}" REDIS_P="${REDIS_PORT:-6379}"
REDIS_PW="${REDIS_PASSWORD:-}" REDIS_PW="${REDIS_PASSWORD:-}"
# 1. Check MySQL # 1. Check MySQL (via docker exec since mysqladmin may not be in CI PATH)
echo "[1/7] Checking MySQL..." echo "[1/7] Checking MySQL..."
mysqladmin ping -h "${REDIS_H}" -u root -p"${MYSQL_ROOT_PASSWORD:-root}" --silent 2>/dev/null || { docker exec mysql mysqladmin ping -u root -p"${MYSQL_ROOT_PASSWORD:-root}" --silent 2>/dev/null || {
echo "MySQL not reachable; ensure MySQL is running" echo "MySQL not reachable via docker; ensure MySQL container is running"
exit 1 exit 1
} }