From ff4ab37546ca19f2179f5d197c94264a740fe311 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Mon, 1 Jun 2026 09:10:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E9=83=A8=E7=BD=B2=E6=B5=8B?= =?UTF-8?q?=E8=AF=95-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy-prod.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/deploy-prod.sh b/scripts/deploy-prod.sh index 1faf991..ab1e3a1 100755 --- a/scripts/deploy-prod.sh +++ b/scripts/deploy-prod.sh @@ -145,7 +145,7 @@ validate_env() { log_error "STORAGE_ENDPOINT 仍指向本机,请改为 http://minio:9000" exit 1 fi - if grep -Eq '=(change-|保持你的|你的)' "${BACKEND_ENV}"; then + if awk -F= '/^[A-Z0-9_]+=/{ if ($0 ~ /=(change-|保持你的|你的)/) found=1 } END { exit found ? 0 : 1 }' "${BACKEND_ENV}"; then log_error "backend/.env 里还有占位值,请先替换后再部署" exit 1 fi @@ -179,9 +179,7 @@ wait_service_healthy() { } mysql_exec() { - local password - password="$(require_env MYSQL_PASSWORD)" - compose exec -T -e MYSQL_PWD="${password}" mysql mysql -u"$(require_env MYSQL_USER)" "$@" + compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u"$MYSQL_USER" "$@"' sh "$@" } mysql_scalar() {