chore/feat: GHCR-based CI/CD + admin metrics dashboard#116
Open
imhyunho99 wants to merge 5 commits into
Open
Conversation
- 1:1 문의 풀스택: entity/repo/service + REST + admin Thymeleaf - 가이드 admin CRUD: 12 endpoints + reorder transaction + dashboard menu - 이미지 스토리지 추상화: LocalFile / S3 자동 전환 (AWS 키 유무로) - 영문 검색 버그 수정: kor_name AND eng_name → OR + case-insensitive - 이미지 variant 컬럼 4개 + 응답 DTO 노출 - 이미지 최적화 CLI (--image-pipeline) — WebP 변환, dry-run 가능 - 환경 분리: application-local/docker/prod 평문 secret 제거 - AdminViewController 신규 (admin UI 라우팅 복구) - uploads/ .gitignore 추가 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI: - PR + feature branch push 시 build + test (이전 -x test 제거) - dev/main 직접 push는 트리거 안 됨 CD (dev push 시): - GHCR 이미지 빌드/푸시 (latest + <sha>, linux/amd64, registry cache) - EC2 SSH → docker login → compose pull/up → cleanup - main은 workflow_dispatch 수동만 (자동화는 후속) docker-compose.yml: image + build 둘 다 보존 (prod=pull, dev=build) Admin dashboard: - 8개 위젯 (오버뷰 4 + 라인차트 + 도넛 + 인기 칵테일/검색어 테이블 + 문의 카드) - AdminDashboardService 신규 - /admin/dashboard 렌더 + /admin/dashboard/data JSON 엔드포인트 - Chart.js CDN, 외부 의존성 0 - 기존 4개 메뉴 링크 보존 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
기존 테스트 7개가 application.yml의 ${POSTGRE_url} / ${JWT_SECRET} 등을
CI 환경에서 해결 못 해 PlaceholderResolutionException 으로 전부 실패.
application-test.yml + @activeprofiles 셋업이 정식 해결책이지만 별도 PR 로 분리.
일단 -x test 복귀해서 CI 그린화.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SecurityConfig — admin 계정 username/password 를 @value 로 환경변수에서 읽음. default 는 admin/admin1! 유지 (개발 편의), 운영 .env 에서 ADMIN_PASSWORD 로 덮어쓰면 됨. docker-compose 에 ADMIN_USERNAME/ADMIN_PASSWORD + AWS_S3_* 환경변수 passthrough 추가. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chore/feat: CI/CD pipeline (GHCR + EC2) + admin metrics dashboard
Summary
두 트랙 묶은 PR.
/admin/dashboard에 회원/문의/검색/인기 칵테일 등 8개 위젯1. CI/CD 파이프라인
CI (
.github/workflows/ci.yml)./gradlew clean build(테스트 포함) → JAR artifact 업로드 / 실패 시 test report 업로드CD (
.github/workflows/cd.yml)workflow_dispatch)./gradlew bootJar -x testghcr.io/mobileonz/cocktail-api:{latest, <sha>}, linux/amd64, registry cachedocker login ghcr.io(전달된 토큰)docker compose pull api-serverdocker compose up -d api-serverdocker system prune -fdocker logoutdocker composev2/v1 자동 감지 fallback 포함docker-compose.yml변경api-server에image: ghcr.io/mobileonz/cocktail-api:${COCKTAIL_API_TAG:-latest}추가build: .도 유지 → 로컬 dev:docker compose up --build, 운영:docker compose pull && up -d사용된 시크릿 (이미 등록돼 있음)
EC2_HOST,EC2_USERNAME,EC2_SSH_KEY(3개)GITHUB_TOKEN(자동 제공, GHCR push용)머지 후 EC2 일회성 셋업
/root/cocktail-api/에 새docker-compose.yml+ 기존.env유지 (git pull 로직 제거됨)push.branches에main추가2. 관리자 대시보드 (
/onz/admin/dashboard)기존 placeholder 메뉴 페이지 → 실제 운영 메트릭 대시보드.
8개 위젯
member.created_at+monitoringmember.social_loginGROUP BYrecommend_count + bookmark count합산search_history.query_text카운트memberORDER BY created_at DESC/admin/dashboard/data기술
domain/admin/service/AdminDashboardService.java— JPA + 네이티브 쿼리 (generate_seriesfor 30d 시리즈)domain/admin/controller/AdminViewController— Model 채워서 dashboard 렌더 + JSON 엔드포인트templates/admin/dashboard.html— 기존 메뉴 4개 보존 + 위젯 그리드 + Chart.js CDN데이터 nuance
monitoring에 last-seen 컬럼 없어COALESCE(updated_at, created_at)사용cocktail_bookmark테이블 비어있어 인기 칵테일 점수는 사실상recommend_count. 데이터 쌓이면 자동 반영search_history.user_id로 비회원 검색 포함. 회원만 카운트하려면WHERE user_id IS NOT NULL추가검증 결과
/admin/dashboard200,/admin/dashboard/data200{"totalMembers":14,"todaySignups":0,"last7dSignups":1,"activeDevicesAllTime":75,"unansweredInquiries":9}변경 파일
보안
GITHUB_TOKEN(워크플로우 자동), EC2 SSH 인증은 GitHub Secrets 3개 (이미 등록된 것).🤖 Generated with Claude Code