chore(ci): preflight migration validation before deploy
TaxBaik CI/CD / build-and-deploy (push) Failing after 3m47s
TaxBaik CI/CD / build-and-deploy (push) Failing after 3m47s
This commit is contained in:
@@ -78,6 +78,9 @@ jobs:
|
||||
- name: Copy migrations
|
||||
run: mkdir -p ./publish/db && cp -r db/migrations ./publish/db/ || true
|
||||
|
||||
- name: Validate migration version uniqueness
|
||||
run: bash scripts/validate_migrations.sh db/migrations
|
||||
|
||||
- name: Generate build info
|
||||
run: |
|
||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
@@ -109,6 +112,9 @@ jobs:
|
||||
- name: Package artifact
|
||||
run: |
|
||||
cp deploy_gb.sh ./publish/deploy_gb.sh
|
||||
mkdir -p ./publish/scripts
|
||||
cp scripts/validate_migrations.sh ./publish/scripts/validate_migrations.sh
|
||||
chmod +x ./publish/scripts/validate_migrations.sh
|
||||
tar -czf taxbaik_deploy.tgz -C ./publish .
|
||||
echo "✓ Package: $(du -sh taxbaik_deploy.tgz | cut -f1)"
|
||||
|
||||
@@ -175,7 +181,12 @@ jobs:
|
||||
test -s "\$DEPLOY_DIR/proxy/TaxBaik.Proxy.dll" \
|
||||
|| { echo "FATAL: TaxBaik.Proxy.dll 없음" >&2; exit 1; }
|
||||
|
||||
echo "--- [3/4] Green-Blue 배포 실행 ---"
|
||||
echo "--- [3/5] 마이그레이션 사전 검증 ---"
|
||||
test -x "\$DEPLOY_DIR/scripts/validate_migrations.sh" \
|
||||
|| { echo "FATAL: validate_migrations.sh 없음" >&2; exit 1; }
|
||||
"\$DEPLOY_DIR/scripts/validate_migrations.sh" "\$DEPLOY_DIR/db/migrations" "postgresql://taxbaik:taxbaik123@localhost:5432/taxbaikdb"
|
||||
|
||||
echo "--- [4/5] Green-Blue 배포 실행 ---"
|
||||
chmod +x "\$DEPLOY_DIR/deploy_gb.sh"
|
||||
"\$DEPLOY_DIR/deploy_gb.sh" "\$DEPLOY_DIR"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user