chore(ci): Alembic步骤增加详细错误输出 - 排查失败根因
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Failing after 1492h25m6s
CI Build & Deploy Pipeline / Deploy Production (pull_request) Failing after 1492h25m7s
CI Build & Deploy Pipeline / Production Browser E2E (push) Failing after 1492h25m7s
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Failing after 1492h25m8s
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Failing after 1492h25m8s
CI Build & Deploy Pipeline / Deploy Production (push) Failing after 1492h25m9s
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Failing after 1492h25m9s
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Failing after 1492h25m10s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Staging E2E Tests (push) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Build Production Web Image (push) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Build Production API Image (push) Failing after 1492h25m13s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 1492h25m13s
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Failing after 1492h25m14s
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Failing after 1492h25m15s
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Failing after 1492h25m15s
CI Build & Deploy Pipeline / Build Staging API Image (push) Failing after 1492h25m16s
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Failing after 1492h56m58s
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Failing after 1492h57m1s
CI Build & Deploy Pipeline / Build Production Worker Image (push) Failing after 1492h56m59s
CI Build & Deploy Pipeline / Build Staging Web Image (push) Failing after 1492h57m3s
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Failing after 1492h25m6s
CI Build & Deploy Pipeline / Deploy Production (pull_request) Failing after 1492h25m7s
CI Build & Deploy Pipeline / Production Browser E2E (push) Failing after 1492h25m7s
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Failing after 1492h25m8s
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Failing after 1492h25m8s
CI Build & Deploy Pipeline / Deploy Production (push) Failing after 1492h25m9s
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Failing after 1492h25m9s
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Failing after 1492h25m10s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Staging E2E Tests (push) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Build Production Web Image (push) Failing after 1492h25m11s
CI Build & Deploy Pipeline / Build Production API Image (push) Failing after 1492h25m13s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 1492h25m13s
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Failing after 1492h25m14s
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Failing after 1492h25m15s
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Failing after 1492h25m15s
CI Build & Deploy Pipeline / Build Staging API Image (push) Failing after 1492h25m16s
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Failing after 1492h56m58s
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Failing after 1492h57m1s
CI Build & Deploy Pipeline / Build Production Worker Image (push) Failing after 1492h56m59s
CI Build & Deploy Pipeline / Build Staging Web Image (push) Failing after 1492h57m3s
This commit is contained in:
+26
-10
@@ -245,17 +245,33 @@ jobs:
|
||||
- name: Validate Alembic migrations
|
||||
if: env.IS_FRONTEND_ONLY != 'true'
|
||||
shell: bash
|
||||
run: 'set -eu
|
||||
|
||||
python3 -m alembic upgrade head --sql > /tmp/alembic-upgrade.sql
|
||||
|
||||
test -s /tmp/alembic-upgrade.sql
|
||||
|
||||
grep -q "Running upgrade" /tmp/alembic-upgrade.sql
|
||||
|
||||
shell: bash
|
||||
run: |
|
||||
set +e
|
||||
echo "=== Validating Alembic migrations ==="
|
||||
python3 -m alembic upgrade head --sql > /tmp/alembic-upgrade.sql 2> /tmp/alembic-err.log
|
||||
RC=0
|
||||
echo "Exit code: "
|
||||
if [ -ne 0 ]; then
|
||||
echo "=== STDERR ==="
|
||||
cat /tmp/alembic-err.log
|
||||
echo "=== STDOUT (last 30 lines) ==="
|
||||
tail -30 /tmp/alembic-upgrade.sql
|
||||
exit 1
|
||||
fi
|
||||
if ! test -s /tmp/alembic-upgrade.sql; then
|
||||
echo "ERROR: empty output"
|
||||
cat /tmp/alembic-err.log
|
||||
exit 1
|
||||
fi
|
||||
if ! grep -q "Running upgrade" /tmp/alembic-upgrade.sql; then
|
||||
echo "ERROR: no Running upgrade"
|
||||
head -30 /tmp/alembic-upgrade.sql
|
||||
exit 1
|
||||
fi
|
||||
python3 scripts/check_schema_metadata.py
|
||||
|
||||
'
|
||||
echo "Alembic validation PASSED"
|
||||
set -e
|
||||
- name: Check migration safety
|
||||
if: env.IS_FRONTEND_ONLY != 'true'
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user