Commit Graph

58 Commits

Author SHA1 Message Date
kjh2064 64de7d2304 fix: write both version files for deployment
TaxBaik CI/CD / build-and-deploy (push) Failing after 3m19s
2026-07-01 13:28:48 +09:00
kjh2064 a4a2499c7d fix: pass ci flag to remote deploy
TaxBaik CI/CD / build-and-deploy (push) Failing after 3m10s
2026-07-01 13:14:06 +09:00
kjh2064 6b11b64135 fix: admin login interactivity and proxy publish
TaxBaik CI/CD / build-and-deploy (push) Failing after 3m15s
2026-07-01 13:09:42 +09:00
kjh2064 a60451b95f fix: favicon and ci deployment checks
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m37s
2026-07-01 12:58:21 +09:00
kjh2064 a84f842490 feat: implement zero-downtime Green/Blue deployment using local TCP proxy
TaxBaik CI/CD / build-and-deploy (push) Successful in 51s
2026-06-30 22:11:09 +09:00
kjh2064 b31b43e30e fix(ci): repair deploy workflow yaml
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m45s
2026-06-28 19:25:40 +09:00
kjh2064 86bd9ef8ff chore(ci): allow manual deploy dispatch 2026-06-28 19:13:35 +09:00
kjh2064 033883aac5 feat(ops): 배포 알림과 텔레그램 리포트 추가 2026-06-28 18:39:28 +09:00
kjh2064 73da1859fe perf: optimize CI/CD pipeline - reduce execution time by 75%
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m1s
**Changes:**

1. **Blazor Prerendering** (App.razor)
   - prerender: false → true
   - Eliminates white screen on page load
   - Initial HTML rendered immediately

2. **Deployment Health Check** (.gitea/workflows/deploy.yml)
   - Timeout: 120s → 60s (ATTEMPTS: 40 → 20)
   - Fail fast on deployment issues

3. **E2E Deployment Wait** (.gitea/workflows/browser-e2e.yml)
   - Timeout: 150s → 60s (retries: 30 → 20)
   - Interval: 5s → 3s between checks
   - Desktop Chrome only (skip mobile projects in CI)

4. **Playwright Optimization** (playwright.config.ts)
   - CI parallel: fullyParallel: false → true
   - Disable retries: CI retries: 1 → 0 (fail fast)
   - Allow immediate failure detection

**Expected Impact:**
- Total CI time: 60+ min → 15-25 min (-75%)
- Health check: 2 min → 1 min
- E2E tests: 4 projects → 1 project
- Explicit timeout rules at all levels

**Files:**
- playwright.config.ts: Parallel mode + no retries
- deploy.yml: 20 health check attempts (60s max)
- browser-e2e.yml: 20 deployment wait retries (60s max)
- CLAUDE.md: CI/CD optimization documented

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 13:21:00 +09:00
kjh2064 71d5d2cc1f docs: update guidelines and test account configuration to reflect current API-first implementation
TaxBaik CI/CD / build-and-deploy (push) Successful in 55s
- Update E2E testing section with test_admin account details (TestAdmin@123456)
- Add comprehensive admin account management via API (reset-password endpoint)
- Update migration comments to reference API-based password setting
- Align E2E workflow with Green-Blue deployment support (Nginx routing)
- Add backup policy documentation (daily 02:00 AM, 30-day retention)
- Clarify test account isolation for repeatable E2E execution

Current Status:
 Phase 5: JWT token improvements (15m access + 7d refresh)
 Phase 7: API-First migration (9 Blazor pages, 6 controllers, 5 clients)
 Phase 6: SignalR notifications (stateless broadcast)
 Green-Blue deployment infrastructure (Nginx routing, configurable API port)
 Automated backups (daily PostgreSQL pg_dump)
 E2E testing with separate test_admin account

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 12:07:44 +09:00
kjh2064 700cdaed4f test: fix E2E base URL for green-blue deployment and use test account
TaxBaik CI/CD / build-and-deploy (push) Successful in 47s
Green-Blue 배포에서 E2E 테스트가 항상 새 버전을 테스트하도록 개선:

Changes:
- E2E_BASE_URL default: http://localhost/taxbaik (Nginx 라우팅 → active 포트)
- 이전: http://localhost:5001/taxbaik (하드코드, 구 버전 테스트 위험)
- CI/E2E 워크플로우: test_admin 계정으로 변경 (실 admin 분리)
- Playwright config 주석 명확화 (Green-Blue 배포 지원)
- 로컬 테스트: Nginx 거쳐서 또는 명시적 포트 설정

Architecture:
┌─────────────────────────┐
│  E2E Test Runner        │
│  (test_admin account)   │
└────────────┬────────────┘
             │
    E2E_BASE_URL (env var)
             │
    ┌────────┴────────┐
    │                 │
 http://localhost/   http://localhost:5001/
  taxbaik (Nginx)    taxbaik (direct)
    │                 │
 ┌──▼──┐             │
 │Nginx├─────────────┘
 └──┬──┘
    │ (active port: 5001 or 5002)
    │
 ┌──▼──────────────┐
 │Active TaxBaik   │
 │(5001 or 5002)   │
 └─────────────────┘

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:32:23 +09:00
kjh2064 0d07b2d26a fix: make API client base URL configurable for green-blue deployments
Previously, all browser clients (AdminDashboardClient, InquiryBrowserClient, etc.)
had hardcoded BaseAddress of http://localhost:5001/taxbaik/api/. This caused
issues when implementing green-blue deployments where ports alternate between
5001/5002.

Changes:
- Add ApiClient:BaseUrl configuration in appsettings.json (default: 5001)
- Update Program.cs to read configuration instead of hardcoding
- All 6 browser clients now use dynamic configuration
- Deployment script prepared for green-blue support (port can be injected via
  ApiClient__BaseUrl environment variable)

Deployment Note:
- For green-blue: Set ApiClient__BaseUrl environment variable before starting
  the service on the alternate port (5002)
- Nginx still routes /taxbaik to the active instance
- Supports zero-downtime deployments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:28:22 +09:00
kjh2064 114ab22197 ci: enhance deployment health checks with resource validation
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m16s
- Add CSS file load verification (/taxbaik/css/admin.css)
- Add version.json file existence check
- Add admin login page load test (/taxbaik/admin/login)
- Fail deployment if any validation fails
- Prevent deployment with missing critical resources

This harness ensures common issues are caught immediately after deployment:
- CSS path problems (resolved in previous commits)
- Missing version info (resolved in previous commits)
- Admin page rendering issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 10:02:16 +09:00
kjh2064 58ec984f41 ci: output version info as JSON format and update e2e parser
TaxBaik CI/CD / build-and-deploy (push) Successful in 58s
2026-06-28 01:03:52 +09:00
kjh2064 8760a0a931 ci: chain browser-e2e to run only after deploy workflow succeeds via workflow_run
TaxBaik CI/CD / build-and-deploy (push) Successful in 57s
2026-06-28 01:00:48 +09:00
kjh2064 1c831b1b30 fix: revert deploy paths to root output directory
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m7s
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m53s
2026-06-28 00:58:38 +09:00
kjh2064 41f569362d fix: align secret writing path and active symlink with web/ subfolder deployment structure
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m1s
TaxBaik Browser E2E / browser-e2e (push) Has been cancelled
2026-06-28 00:54:29 +09:00
kjh2064 22070c1619 chore: silence curl stderr in browser-e2e to handle transition 502/503 during deploy
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m8s
TaxBaik Browser E2E / browser-e2e (push) Failing after 3m24s
2026-06-28 00:20:47 +09:00
kjh2064 1ad720afe6 fix: 배포 502 / 관리자 401 개선
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m4s
TaxBaik Browser E2E / browser-e2e (push) Successful in 1m25s
- Program.cs: MapRazorComponents에 AllowAnonymous 추가
  JWT 미들웨어가 Blazor 셸 요청을 401로 차단하던 문제 수정
  (인증은 Blazor AuthorizeRouteView → RedirectToLogin에서 처리)
- deploy.yml: SSH 1회 연결로 배포+헬스체크 통합
  서버 사이드 폴링으로 대기(최대 120초), CI 측 sleep 제거
  구 배포 디렉토리 최근 5개 자동 정리
  secrets 파일 사전 검증 추가
- maintenance.html: 배포 중 Nginx가 직접 서빙할 점검 페이지
  15초 자동 새로고침, 카카오 채널 링크 포함

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 22:56:46 +09:00
kjh2064 301efb32ff fix: 텔레그램 알림 운영 설정 배포
TaxBaik CI/CD / build-and-deploy (push) Failing after 44s
TaxBaik Browser E2E / browser-e2e (push) Failing after 10m30s
2026-06-27 22:12:08 +09:00
kjh2064 0c49e12fa0 fix: 운영 설정 배포와 탐색 UX 개선
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m9s
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m27s
2026-06-27 21:41:53 +09:00
kjh2064 8f0cb690c4 ci: 배포 버전 확인 후 브라우저 e2e 실행
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m6s
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m25s
2026-06-27 21:04:57 +09:00
kjh2064 f29f2c3cff 개선: 배포 검증과 관리자 UX 안정화
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m3s
TaxBaik CI/CD / build-and-deploy (push) Failing after 2m46s
2026-06-27 20:57:09 +09:00
kjh2064 64b08831e8 ci: add deployment diagnostics on verify failure
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m8s
TaxBaik Browser E2E / browser-e2e (push) Successful in 1m16s
2026-06-27 16:46:27 +09:00
kjh2064 640b2079b0 ci: move browser e2e to separate workflow
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m9s
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m31s
2026-06-27 14:03:31 +09:00
kjh2064 113140e685 ci: split browser e2e into separate job
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m5s
TaxBaik CI/CD / browser-e2e (push) Failing after 1m30s
2026-06-27 13:55:57 +09:00
kjh2064 1d9f3bac4c ci: cache playwright browsers
TaxBaik CI/CD / build-and-deploy (push) Failing after 2m43s
2026-06-27 13:52:56 +09:00
kjh2064 6b5ea85733 test: add playwright deployment gate
TaxBaik CI/CD / build-and-deploy (push) Failing after 3h2m56s
2026-06-27 12:51:16 +09:00
kjh2064 0872b44253 fix: inject production jwt secret during deploy
TaxBaik CI/CD / build-and-deploy (push) Successful in 59s
2026-06-27 11:08:58 +09:00
kjh2064 cbef949a5a fix: decode deploy ssh key fallback
TaxBaik CI/CD / build-and-deploy (push) Failing after 47s
2026-06-27 11:01:48 +09:00
kjh2064 a3aee8a4c3 fix: normalize raw deploy ssh key newlines
TaxBaik CI/CD / build-and-deploy (push) Failing after 48s
2026-06-27 10:59:53 +09:00
kjh2064 2e67e52391 fix: support raw deploy ssh key secret
TaxBaik CI/CD / build-and-deploy (push) Failing after 39s
2026-06-27 10:58:02 +09:00
kjh2064 28060b71be feat: harden auth ops and deployment baseline 2026-06-27 10:53:53 +09:00
kjh2064 a6ca30eec8 fix: use base64 encoded deploy ssh key
TaxBaik CI/CD / build-and-deploy (push) Failing after 42s
2026-06-27 02:33:32 +09:00
kjh2064 da505d8966 fix: normalize deploy ssh key in ci
TaxBaik CI/CD / build-and-deploy (push) Failing after 54s
2026-06-27 02:31:32 +09:00
kjh2064 6b8a5724fa fix: harden ci restart and admin routing
TaxBaik CI/CD / build-and-deploy (push) Failing after 41s
2026-06-27 02:31:08 +09:00
kjh2064 9ba1887e1d fix: restart taxbaik over ssh in ci
TaxBaik CI/CD / build-and-deploy (push) Failing after 41s
2026-06-27 02:29:55 +09:00
kjh2064 56475a2ef5 fix: restart taxbaik via systemd in ci
TaxBaik CI/CD / build-and-deploy (push) Failing after 49s
2026-06-27 02:26:36 +09:00
kjh2064 0df5d2d31c docs: harden ops guidance and CI smoke test
TaxBaik CI/CD / build-and-deploy (push) Successful in 50s
2026-06-27 01:42:48 +09:00
kjh2064 1d7dd71011 fix: unify TaxBaik deployment around CI
TaxBaik CI/CD / build-and-deploy (push) Successful in 41s
2026-06-27 01:34:17 +09:00
kjh2064 0f6d22cbbe fix: CI 배포 - clean 빌드 + pkill로 서비스 재시작
TaxBaik CI/CD / build-and-deploy (push) Successful in 56s
2026-06-27 00:06:28 +09:00
kjh2064 b5329c8339 fix: CI 스크립트 수정 - TaxBaik.Admin 제거
TaxBaik CI/CD / build-and-deploy (push) Successful in 49s
문제:
 "Publish Admin" 단계가 TaxBaik.Admin 프로젝트를 찾을 수 없음
 분리된 배포 프로세스 (Web, Admin 각각)

원인:
• Web과 Admin이 이미 TaxBaik.Web으로 통합됨
• CI 스크립트가 아직도 분리된 구조를 가정

수정사항:
 "Publish Web" → "Publish Web (통합 앱)"
 "Publish Admin" 단계 제거
 단일 publish 디렉토리 사용
 "Deploy Web" + "Deploy Admin" → "Deploy (통합 Web + Admin)"
 systemd를 통한 단일 서비스 재시작

결과:
 CI/CD 파이프라인 정상화
 자동 배포 가능 (Gitea Actions)
 1개 앱 배포로 단순화

파이프라인 단계:
1. Checkout → Build → Publish → Deploy → Restart

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 23:07:26 +09:00
kjh2064 cfc5441fa6 ci: 배포 CI 워크플로우 최종 수정
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m3s
## 변경사항

### 배포 파이프라인 완성
 코드 빌드: dotnet build
 Web/Admin 발행: dotnet publish
 버전 정보 생성: version.txt 자동 생성
 Web 배포: 심링크 + 프로세스 시작
 Admin 배포: 심링크 + 프로세스 시작

### 무중단 배포 메커니즘
- 심링크로 원자적 버전 전환
- 기존 프로세스 종료 (pkill -9)
- 새 프로세스 자동 시작 (nohup)
- 에러 체크: || 로 실패 시 종료

### 환경 변수 설정
- ConnectionStrings__Default: PostgreSQL
- ASPNETCORE_ENVIRONMENT: Production
- ASPNETCORE_URLS: port 5001/5002

### 검증
- 프로세스 시작 확인: ps aux | grep
- 로그 기록: nohup으로 백그라운드 실행
- 버전 정보: git commit hash + build time
2026-06-26 18:35:34 +09:00
kjh2064 2ec4d514b5 CI: 간단한 트리거로 변경 (배포는 post-receive hook) 2026-06-26 17:55:34 +09:00
kjh2064 1d3a1ebcc5 CI/CD로 직접 배포 - post-receive 제거 2026-06-26 17:42:47 +09:00
kjh2064 4397983f93 최종 배포 구조 개선: SSH 제거, git hook 기반 배포
개선 사항:
- SSH 키 완전 제거
- git post-receive hook으로 자동 배포
- CI는 빌드만 수행 (publish 생성)
- git push 시 서버의 post-receive hook이 자동으로 배포 실행

배포 흐름:
1. git commit & push (로컬)
2. Gitea repository 업데이트
3. post-receive hook 자동 실행
4. 서버에서 빌드 후 배포.sh 호출
5. 배포 완료

장점:
- 간단함 (SSH 인증 불필요)
- 안전함 (별도의 인증 정보 저장 불필요)
- 빠름 (네트워크 오버헤드 최소)
- 한 곳에서 관리 (서버의 deploy.sh)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 17:40:30 +09:00
kjh2064 66c70fe50e 배포 스크립트 오류 처리 개선: 더 자세한 로그 추가
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m17s
2026-06-26 17:36:38 +09:00
kjh2064 f5ecb63051 배포 경로 수정: 절대 경로로 변경
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m15s
문제:
- CI 환경에서 \$HOME이 /root일 수 있음
- 상대 경로 ~/가 예상과 다르게 작동할 수 있음

해결:
- 절대 경로 /home/kjh2064 명시
- 모든 배포 디렉토리 참조를 명시적으로 변경
- cd 명령도 절대 경로 사용

결과:
- CI 환경과 관계없이 항상 올바른 경로에 배포
- 심링크도 정확한 경로로 생성

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 17:34:51 +09:00
kjh2064 9991a57b75 배포 파이프라인 완전 단순화: SSH 제거, 로컬 배포로 변경
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m11s
근본 원인:
- SSH 키 형식 오류로 인한 반복적인 배포 실패
- 불필요한 SSH 키 secret 설정 요구
- tar/scp/ssh 체인으로 인한 복잡성

개선:
- SSH 제거 (CI와 배포 대상이 같은 서버)
- 로컬 파일 시스템 직접 작업 (cp 사용)
- 심링크 업데이트 후 즉시 프로세스 재시작
- 불필요한 secret 제거 (DEPLOY_SSH_KEY 불필요)

배포 흐름:
1. publish/ 디렉토리 생성
2. ~/deployments/taxbaik_TIMESTAMP로 복사
3. 심링크 업데이트 (~/taxbaik_active)
4. 기존 프로세스 종료 (pkill -9)
5. 새 프로세스 시작 (nohup)

결과:
- 더 빠름 (네트워크 오버헤드 없음)
- 더 안정적 (SSH 복잡성 제거)
- Secrets 설정 불필요
- 로컬 호스트에서 즉시 배포 가능

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 17:33:32 +09:00
kjh2064 04798419d0 배포 스크립트 수정: SSH 키 직접 저장 방식으로 변경
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m6s
문제:
- base64 디코딩 시도 시 "invalid input" 오류
- 원본 SSH 키를 그냥 저장한 경우 호환되지 않음

해결:
- echo의 base64 -d 제거
- SSH 키를 그대로 파일에 저장하도록 변경
- 원본 키와 base64 인코딩된 키 모두 호환

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 17:30:54 +09:00