Commit c8c6943a by luoqi

fix(deploy): migrate status 校验不再 tail 截断 — prisma 版本提示框位置不固定致误报

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 87741f59
......@@ -45,8 +45,9 @@ done
log "验证 2/3:数据库迁移无 pending(migrate 容器 exit 0 且 deploy 干净)"
mexit=$(docker inspect "${proj}-pac-migrate-1" --format '{{.State.ExitCode}}')
[[ "$mexit" == "0" ]] || die "migrate 容器 exit=$mexit(看 docker logs ${proj}-pac-migrate-1)"
docker exec "${proj}-pac-service-1" sh -c 'npx prisma migrate status 2>&1' | tail -3 \
| grep -qiE 'up to date|database schema is up to date' || die "迁移有 pending / 状态异常"
# 注:prisma 的"新版本提示框"打印位置不固定(异步),不能 tail 截断 —— 全量输出里 grep
docker exec "${proj}-pac-service-1" sh -c 'npx prisma migrate status 2>&1' \
| grep -qiE 'database schema is up to date' || die "迁移有 pending / 状态异常"
echo " migrate OK"
log "验证 3/3:health + web"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment