一键部署测试-2

This commit is contained in:
yml2213
2026-06-01 09:10:30 +08:00
parent 6e5a393fd6
commit ff4ab37546
+2 -4
View File
@@ -145,7 +145,7 @@ validate_env() {
log_error "STORAGE_ENDPOINT 仍指向本机,请改为 http://minio:9000" log_error "STORAGE_ENDPOINT 仍指向本机,请改为 http://minio:9000"
exit 1 exit 1
fi 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 里还有占位值,请先替换后再部署" log_error "backend/.env 里还有占位值,请先替换后再部署"
exit 1 exit 1
fi fi
@@ -179,9 +179,7 @@ wait_service_healthy() {
} }
mysql_exec() { mysql_exec() {
local password compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u"$MYSQL_USER" "$@"' sh "$@"
password="$(require_env MYSQL_PASSWORD)"
compose exec -T -e MYSQL_PWD="${password}" mysql mysql -u"$(require_env MYSQL_USER)" "$@"
} }
mysql_scalar() { mysql_scalar() {