docs: Finalize Phase 4-5 CI/CD (Manual SSH deployment strategy, Gitea Actions reference)
Deploy to Production / Build Release (push) Failing after 39s
Deploy to Production / Pre-Deployment Verification (push) Has been skipped
Deploy to Production / Deploy to Production (push) Has been skipped
Deploy to Production / Post-Deployment Reporting (push) Successful in 1s

- Add Phase 4: CI/CD Pipeline Hardening status (80% complete)
  • deploy-prod.yml 4-stage pipeline (223 lines) ✓
  • Workflow consolidation (ci.yml + deploy-prod.yml) ✓
  • SSH_KEY secret registered ✓
  • Note: Act runner network limitation (workaround: manual SSH) ⚠️

- Add Phase 5: Admin UI & Deployment Optimization (complete)
  • Tabler redesign (dashboard, sidebar, responsive) ✓
  • Build: 0 errors, 0 warnings ✓
  • E2E tests: 8/8 passing ✓
  • Production: commit 30fb702 active since 21:00:55 KST ✓

- Update Deployment & Operations section:
  • Add complete manual SSH deployment procedure
  • Add rollback instructions
  • Document Gitea Actions limitation + workaround
  • Add health check and monitoring commands
  • Reference docs/GITEA_ACTIONS_API_GUIDE.md

- Add docs/GITEA_ACTIONS_API_GUIDE.md:
  • Gitea API reference (Run/Job queries)
  • PowerShell/Bash examples
  • Troubleshooting guide
  • FAQ

Decision: Option A (Current State Maintained) — Stable manual SSH deployment, infrastructure-limited auto-deployment.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 22:49:29 +09:00
parent 5b41423aef
commit e0af3c3d34
2 changed files with 372 additions and 8 deletions
+120 -8
View File
@@ -67,13 +67,43 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- Makefile created (npm → make mappings)
- np operations documented
**Phase 4: CI/CD Pipeline Hardening** ✅ 80% COMPLETE (2026-07-11)
- ✅ deploy-prod.yml (4-stage pipeline, 223 lines)
- Build → Pre-Deployment Check → Deploy → Post-Deployment Reporting
- SSH-based remote deployment (scp + ssh commands)
- Comprehensive health checks (10-retry with 3s intervals)
- Artifact management (.tar.gz)
- ✅ Workflow consolidation (2 active files)
- ci.yml: PR validation only (maintains 29 validators)
- deploy-prod.yml: Production deployment
- Deleted: merge-to-main.yml (non-functional), fast-validation.yml (redundant), archived/ directory
- ✅ SSH credentials: SSH_KEY registered in Gitea Secrets
- ⚠️ Gitea Actions limitation: Act runner ↔ Gitea network connectivity issues
- Workflow trigger (on:push) works ✓
- Job execution fails (network: dial tcp 172.18.0.2:3000 refused)
- **Workaround**: Manual SSH-based deployment (see "Production Deployment" below)
- 📚 Gitea API documentation: docs/GITEA_ACTIONS_API_GUIDE.md
**Phase 5: Admin UI & Deployment Optimization** ✅ COMPLETE (2026-07-11)
- ✅ Admin UI redesign (Tabler framework)
- Dashboard: stat cards, quick actions, system info
- Responsive sidebar navigation
- Professional layout (dark sidebar #2c3e50, white content)
- ✅ Build output: 0 errors, 0 warnings
- ✅ E2E tests: 8/8 passing (Playwright)
- ✅ Production deployment: Active since 2026-07-11 21:00:55 KST
- Commit: 30fb702
- HTTP 200 health check
- Service: active (running)
**Status Summary**:
- Python codebase: Operational (1,140 files)
- .NET 9 coverage: Core (✅), Infrastructure (✅), API (✅), Web UI (✅)
- Database: PostgreSQL fully migrated
- CI/CD: Manual SSH deployment (fully operational), Gitea Actions (limited by infrastructure)
- Release gates: Python gates remain authority until Phase 2 integration testing complete
## Deployment & Operations
## Deployment & Operations (Phase 4-5, 2026-07-11)
**Production Server**: Hetzner Cloud `178.104.200.7` (kjh2064@178.104.200.7)
@@ -81,22 +111,104 @@ Projects on server:
1. **TaxBaik** (홈페이지) — Nginx location `/taxbaik`
2. **QuantEngine** (데이터 수집/분석) — Nginx location `/quantengine`
See [Temp/DEPLOYMENT_GUIDE.md](Temp/DEPLOYMENT_GUIDE.md) for deployment procedures.
### Production Deployment Strategy (Manual SSH-Based)
### Quick Deploy (QuantEngine)
**Current Status**: Gitea Actions automated deployment limited by infrastructure constraints. Deployed via stable manual SSH pipeline.
**Pre-Deployment Checklist**:
1. ✅ Local build: `dotnet build src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj -c Release`
2. ✅ E2E tests pass: `npx playwright test`
3. ✅ Admin pages verified (200 status, no 500 errors)
4. ✅ Commit to main branch: `git push origin main`
**Deployment Procedure** (Manual SSH):
```powershell
# 1. SSH into production server
ssh kjh2064@178.104.200.7
systemctl status quantengine-api
journalctl -u quantengine-api -f
sudo systemctl restart quantengine-api
# 2. Navigate to deployment directory
cd ~/deployments
# 3. Run deployment script (or manual steps below)
./deploy.sh
# OR manual deployment:
# ─────────────────────
# 3a. Build release artifact locally, then SCP to server:
dotnet publish src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj -c Release -o ./publish
tar -czf quantengine-release.tar.gz -C ./publish .
scp quantengine-release.tar.gz kjh2064@178.104.200.7:/tmp/
# 3b. On production server, extract and deploy:
mkdir -p ~/deployments/quantengine_$(date +%Y%m%d_%H%M%S)_$(git rev-parse --short HEAD)
tar -xzf /tmp/quantengine-release.tar.gz -C $DEPLOY_DIR
ln -sfn $DEPLOY_DIR ~/quantengine_active
systemctl restart quantengine
# 4. Verify deployment
curl http://127.0.0.1:5000/Account/Login
systemctl status quantengine
journalctl -u quantengine -n 20
```
**Monitoring Post-Deployment**:
```powershell
# Check service status
systemctl status quantengine.service
# View live logs
journalctl -u quantengine.service -f
# Verify active deployment
readlink ~/quantengine_active
# Health check (HTTP)
curl -I http://127.0.0.1:5000/Account/Login
```
### Rollback Procedure
```bash
# List recent deployments
ls -lht ~/deployments/quantengine_* | head -10
# Rollback to previous deployment
PREV_DEPLOY=$(ls -dt ~/deployments/quantengine_* | head -2 | tail -1)
ln -sfn $PREV_DEPLOY ~/quantengine_active
systemctl restart quantengine
# Verify
systemctl status quantengine
curl http://127.0.0.1:5000/Account/Login
```
### Gitea Actions (Limited - For Reference)
**Status**: Workflow trigger works (on:push detected), but Act runner cannot execute jobs due to Docker network constraints.
**Workaround**: Use manual SSH deployment (above). Gitea Actions configuration is prepared in:
- `.gitea/workflows/deploy-prod.yml` (4-stage pipeline, ready)
- `docs/GITEA_ACTIONS_API_GUIDE.md` (API reference for monitoring)
**API Monitoring** (when Actions are operational):
```powershell
$token = $env:GITEA_TOKEN_TAXBAIK
$response = Invoke-WebRequest `
-Uri "https://gitea.taxbaik.com/api/v1/repos/kjh2064/QuantEngineByItz/actions/runs?limit=5" `
-Headers @{ "Authorization" = "token $token" }
($response.Content | ConvertFrom-Json).workflow_runs | ForEach-Object {
Write-Host "Run #$($_.id): $($_.display_title) [$($_.conclusion)]"
}
```
See `docs/GITEA_ACTIONS_API_GUIDE.md` for complete API documentation.
### Git Repository
**Gitea Server** (동일 호스트):
- **HTTP**: `http://178.104.200.7/kjh2064/QuantEngineByItz.git`
- **SSH**: `git@178.104.200.7:2222/...`
- **HTTP**: `https://gitea.taxbaik.com/kjh2064/QuantEngineByItz.git`
- **SSH**: `ssh://git@gitea.taxbaik.com:2222/kjh2064/QuantEngineByItz.git`
## UI Design Principles (2026-07-11 — Migrated to Razor Pages)