Spaces:
Running
Running
File size: 797 Bytes
4cb7ab8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #!/bin/bash
# Safe Deployment Script for VisaBerry / QuickTools
echo "π Starting Safe Deployment Process..."
# 1. Run Backend Unit Tests
echo "π§ͺ Running Backend Tests..."
cd backend
if venv/bin/pytest test_main.py; then
echo "β
Tests Passed!"
else
echo "β Tests Failed! Deployment Aborted."
exit 1
fi
cd ..
# 2. Build Frontend
echo "ποΈ Building Frontend..."
cd frontend
rm -rf .next
if npm run build; then
echo "β
Build Successful!"
else
echo "β Build Failed! Deployment Aborted."
exit 1
fi
# 3. Zero-Downtime Reload via PM2
echo "π Reloading Services..."
pm2 reload visa-frontend
# Backend is usually fast, restart is fine, or also reload if using gunicorn
pm2 restart visa-backend
echo "β¨ Deployment Complete! VisaBerry is live and stable."
|