-
Notifications
You must be signed in to change notification settings - Fork 1
feat: lambda CI/CD 구축 완료 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Summary by CodeRabbit
Walkthrough이 변경사항은 서버리스 함수의 배포 프로세스 자동화를 위해 GitHub Actions 기반의 CI/CD 파이프라인을 추가하는 데 중점을 두고 있습니다. 두 개의 워크플로우 파일이 새롭게 도입되어, 하나는 메인 브랜치에 푸시될 때 AWS Lambda에 배포(CD), 다른 하나는 풀 리퀘스트 생성 시 빌드 및 테스트(CI)를 수행합니다. 또한, README 파일이 포맷 개선과 시스템 아키텍처 이미지 추가를 통해 업데이트되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub Actions
participant AWS Lambda
participant Slack
Developer->>GitHub Actions: main 브랜치에 push
GitHub Actions->>GitHub Actions: 코드 checkout, JDK/Gradle 세팅, .env 생성
GitHub Actions->>GitHub Actions: Gradle 빌드(shadowJar)
GitHub Actions->>AWS Lambda: Lambda 코드 배포
alt 배포 성공
GitHub Actions->>Slack: 성공 알림 전송
else 배포 실패
GitHub Actions->>Slack: 실패 알림 전송
end
Assessment against linked issues
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)
16-33: 중복 스텝 재사용 액션 제안: JDK 설정, Gradle 캐싱,.env생성 같은 공통 스텝을 컴포지트 액션 또는 재사용 가능한 워크플로우로 분리하면 유지보수성이 향상됩니다..github/workflows/cd.yml (1)
34-36: Shadow JAR 빌드 명시 고려:./gradlew build대신./gradlew shadowJar를 명시하면 빌드 의도를 더 명확히 전달할 수 있습니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/cd.yml(1 hunks).github/workflows/ci.yml(1 hunks)README.md(1 hunks)
🔇 Additional comments (15)
README.md (2)
13-16: 리스트 항목 가독성 향상: 굵은 텍스트를 사용하여 주요 기술 결정이 강조되어 문서의 가독성이 개선되었습니다.
24-26: 시스템 아키텍처 다이어그램 추가: 시각적 다이어그램을 통해 서비스 구조를 명확히 전달할 수 있어 유용합니다..github/workflows/ci.yml (6)
3-7: PR 기반 CI 트리거 적절성:main브랜치 대상 PR에서만 실행되도록 설정하여 불필요한 빌드를 방지하고 효율성을 높였습니다.
10-13: 권한 최소화 설정:permissions: contents: read로 레파지토리 콘텐츠 읽기 권한만 부여하여 보안을 강화했습니다.
16-21: JDK 21 설정 일관성: Corretto 21을 명시해 Lambda 런타임 환경과 버전 호환성을 확보했습니다.
22-24: Gradle 캐싱 사용: 빌드 속도를 단축하기 위해 Gradle 캐시 액션을 활용한 점이 적절합니다.
25-33: 환경 변수 주입 방식 검증 필요:src/main/resources/.env파일 생성 후 애플리케이션이 이를 올바르게 로드하는지 구현상 확인이 필요합니다.
35-38: 컴파일 및 테스트 실행 확인:./gradlew check로 컴파일과 테스트를 수행해 CI 핵심 역할을 충실히 이행하고 있습니다..github/workflows/cd.yml (7)
3-7: 푸시 기반 CD 트리거 적절성:main브랜치로의 푸시 시 자동 배포되도록 설정하여 운영 효율성을 높였습니다.
15-20: JDK 21 구성 일관성: CI 워크플로우와 동일한 Corretto 21을 사용해 환경 차이를 최소화했습니다.
21-23: Gradle 캐싱 사용: 빌드 시간을 줄이기 위해 캐시 설정이 잘 적용되었습니다.
24-32: 환경 변수 주입 일관성 확인: CI와 동일한.env파일 생성 방식을 사용하지만, CD 전용 Slack Webhook 설정과 충돌 여부를 검증해야 합니다.
37-43: AWS 인증 설정 적절: AWS 자격 증명을 시크릿으로 안전하게 관리하고configure-aws-credentials액션을 활용해 안정적으로 설정했습니다.
44-50: 배포 아티팩트 경로 검증 필요:build/libs/sentry-webhook-shadow.jar경로와 실제 생성된 JAR 파일명이 일치하는지 확인해주세요.
51-73: Slack 알림 구성 적절: 성공/실패 경우를 구분한 색상 메시지로 전송해 배포 모니터링 편의성을 높였습니다.
Related issue 🛠
Work Description ✏️
진행사항
✅ CI 설명 (sentry-notifier-lambda-ci)
이 워크플로우는 Pull Request 시점에서 코드 품질을 검증하는 데에만 초점을 맞춘 CI입니다.
✅ CD 설명 (sentry-notifier-lambda-cd)
이 워크플로우는 main 브랜치에 push될 때 실제 Lambda로 배포까지 책임지는 CD입니다.
✅ 결론: 왜 아티팩트를 저장하지 않고 바로 배포했는가?
Trouble Shooting ⚽️