Repository navigation
[Chore] API CI/CD 리팩토링 및 AWS EC2 배포 전환 - #88
Merged
Merged
Conversation
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: GNU-connect/Server-Node/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- app healthcheck, nginx depends_on 유지 - gcplogs 제거, 전 서비스 json-file 로깅(10m x 3)으로 통일 - prod.conf 도메인 api.connectgnu.kro.kr로 통일, /api/metrics 접근 제한 유지 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
잘못된 설정이 배포될 때 nginx가 재생성되며 crash-loop로 80/443이 내려가는 문제를 막는다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JangDongHo
force-pushed
the
chore/api-cicd-aws
branch
from
September 24, 2026 13:03
12b0fab to
96aafab
Compare
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.
📌 개요
/opt/connectgnu/api)로 전환하고, GitHub Actions CI/CD를CI 통과 → 이미지 빌드/푸시 → 배포 → 헬스체크흐름으로 정리했습니다.docker-compose.yml과nginx/prod.conf를 EC2 서버 반영본으로 동기화했습니다.✨ 작업 내용
CI (
api-ci.yml)workflow_call트리거를 추가해 CD에서 재사용하도록 전환했습니다.verify로 바꾸고 lint → test 뒤에pnpm build검증을 추가했습니다.app/package.json의packageManager에서 읽도록 하고 액션을 최신 메이저로 올렸습니다.CD (
api-cd.yml)ci → build-and-push → deploy순서로 실행해 CI를 통과한 커밋만 배포합니다.target: prod를 명시하고 빌드에 영향을 주는 경로(.dockerignore,tsconfig*.json,nest-cli.json)를 트리거에 추가했습니다.cancel-in-progress: false)로 진행 중인 배포가 취소되지 않게 했습니다./opt/connectgnu/api로,docker compose(v2) 문법을 쓰고sudo는 제거했습니다.docker-compose.yml,nginx/prod.conf만 동기화합니다.letsencrypt/,.env는 건드리지 않습니다.unhealthy이거나 healthcheck가 없으면 로그를 출력하고 실패합니다.compose run --rm)로nginx -t를 먼저 검사하고, 통과하면 반영하고 reload합니다.image prune -af를-f로 바꿨습니다.운영 설정
gcplogs를 제거하고 모든 서비스를json-file로깅(10m × 3)으로 통일했습니다../nginx:/etc/nginx/conf.d:ro)로 변경했습니다.prod.conf도메인을api.connectgnu.kro.kr로 통일하고/api/metricsIP 제한을 유지했습니다.기타
test:api/test:mobile스크립트를pnpm --dir <pkg> exec jest --runInBand로 변경했습니다. mobile은packageManager가 없어 최신 pnpm이 실행되는데, 이 버전이--를 jest에 그대로 넘겨No tests found로 pre-push 훅이 실패하던 문제입니다. (pnpm 9는 반대로--없이는--runInBand를 pnpm 옵션으로 해석)문서
docs/superpowers/specs/2026-09-24-api-cicd-aws-migration-design.mddocs/superpowers/plans/2026-09-24-api-cicd-aws-migration.md🔥 변경 이유
gcplogs로깅 드라이버는 AWS에서 동작하지 않아 컨테이너 기동이 실패합니다.mainpush만으로 바로 배포했고, 배포 후 앱이 정상인지 확인하지 않았습니다.prod.conf변경이 반영되지 않습니다.nginx -t를 하면, 잘못된 설정일 때 재생성된 nginx가 crash-loop로 80/443을 내립니다. 검사를 먼저 하도록 순서를 바꿨습니다.target: prod는 Dockerfile 단계 순서가 바뀌어도 운영 이미지가 개발 단계로 빌드되지 않도록 명시했습니다.🧪 테스트
actionlint:api-ci.yml,api-cd.yml통과services/api/app에서pnpm lint:check,pnpm test(74/74),pnpm build통과docker build --target prod통과docker compose config통과,prod.conf만 담은 디렉터리로nginx -t통과(dev.conf가 섞이면duplicate upstream실패 확인)bash -n, shellcheck 통과pnpm test: api 74/74, mobile 7/7 통과머지 전 확인 (배포 사전 조건)
API_SSH_HOST(EC2 EIP),API_SSH_USERNAME(ec2-user),API_SSH_PRIVATE_KEY교체docker compose version,ec2-user의docker그룹 소속, 로그인 셸이 bash/opt/connectgnu/api/nginx/에prod.conf만 있음,letsencrypt/conf/live/api.connectgnu.kro.kr-0001존재참고
🔗 관련 이슈
🤖 Generated with Claude Code
Summary by CodeRabbit