Files
igny8/work-docs/DEPLOYMENT-GUIDE.md
2025-12-04 15:54:15 +00:00

127 lines
3.0 KiB
Markdown

# Quick Deployment Guide
**Date:** December 4, 2025
## Files Changed
### Modified Files (4)
1.`backend/igny8_core/business/automation/services/automation_service.py`
2.`backend/igny8_core/business/automation/views.py`
3.`frontend/src/pages/Automation/AutomationPage.tsx`
4.`frontend/src/services/automationService.ts`
### New Files (1)
5.`frontend/src/components/Automation/CurrentProcessingCard.tsx`
## Quick Deployment Commands
### Option 1: Docker Compose (Recommended)
```bash
# Navigate to project root
cd /data/app/igny8
# Rebuild and restart services
docker-compose down
docker-compose build
docker-compose up -d
# Check logs
docker-compose logs -f backend
docker-compose logs -f frontend
```
### Option 2: Manual Deployment
**Backend:**
```bash
cd /data/app/igny8/backend
# If using systemd service
sudo systemctl restart igny8-backend
# Or if using supervisor
sudo supervisorctl restart igny8-backend
# Or if running manually with gunicorn
pkill -f gunicorn
gunicorn igny8_core.wsgi:application --bind 0.0.0.0:8000 --workers 4 --daemon
```
**Frontend:**
```bash
cd /data/app/igny8/frontend
# Build production assets
npm run build
# If using nginx, copy to webroot
sudo cp -r dist/* /var/www/igny8/
# Restart nginx
sudo systemctl restart nginx
```
## Verification Steps
### 1. Verify Backend
```bash
# Test automation endpoint
curl "http://localhost:8000/api/v1/automation/current_processing/?site_id=1&run_id=test" \
-H "Authorization: Bearer YOUR_TOKEN"
# Should return: {"data": null} if no run is active
```
### 2. Verify Frontend
```bash
# Check if CurrentProcessingCard.tsx is in bundle
ls -lh frontend/dist/assets/js/AutomationPage-*.js
# Should see file with recent timestamp
```
### 3. Test End-to-End
1. Open automation page in browser
2. Click "Run Now"
3. Verify CurrentProcessingCard appears at top
4. Confirm progress updates every 3 seconds
5. Check Stage 6 image generation completes successfully
## Rollback Plan
If issues occur:
```bash
# Git rollback
cd /data/app/igny8
git checkout HEAD~1 backend/igny8_core/business/automation/services/automation_service.py
git checkout HEAD~1 backend/igny8_core/business/automation/views.py
git checkout HEAD~1 frontend/src/pages/Automation/AutomationPage.tsx
git checkout HEAD~1 frontend/src/services/automationService.ts
rm frontend/src/components/Automation/CurrentProcessingCard.tsx
# Rebuild and restart
docker-compose down && docker-compose build && docker-compose up -d
```
## Environment Notes
- ✅ No database migrations required
- ✅ No new dependencies added
- ✅ No configuration changes needed
- ✅ Backward compatible with existing data
## Success Criteria
- [ ] Backend starts without errors
- [ ] Frontend builds successfully
- [ ] Automation page loads without console errors
- [ ] CurrentProcessingCard shows when automation runs
- [ ] Stage 6 generates images successfully
- [ ] No memory leaks (check browser dev tools)
---
**Deployment Status:** ✅ Ready for Production