Skip to content

운영 서버 배포를 위한 설정을 한다.#78

Merged
strongmhk merged 4 commits intodevelopfrom
chore/#73-prod-deploy-setting
Oct 19, 2025
Merged

운영 서버 배포를 위한 설정을 한다.#78
strongmhk merged 4 commits intodevelopfrom
chore/#73-prod-deploy-setting

Conversation

@strongmhk
Copy link
Copy Markdown
Member

@strongmhk strongmhk commented Oct 19, 2025

📄 PR 요약

운영 서버 배포를 위한 설정을 한다.

✍🏻 PR 상세

  1. Jenkins 스크립트 작성
  2. Spring Profile을 동적으로 설정하도록 Dockerfile, dev-cd.yml 변경
  3. Blue/Green Deploy를 위한 deploy.sh 작성

👀 참고사항

✅ 체크리스트

  • PR 양식에 맞게 작성했습니다.
  • 모든 테스트가 통과했습니다.
  • 프로그램이 정상적으로 작동합니다.
  • 적절한 라벨을 설정했습니다.
  • 불필요한 코드를 제거했습니다.

🚪 연관된 이슈 번호

Closes #73

Summary by CodeRabbit

릴리즈 노트

  • 새로운 기능

    • 프로덕션 환경의 OAuth 설정 추가 (Google, Apple 인증 지원)
  • 개선사항

    • CI/CD 파이프라인 자동화 및 최적화
    • 프로덕션 배포 프로세스 개선
    • 모니터링 샘플링 레이트 조정으로 성능 최적화
    • 개발 및 프로덕션 환경 설정 명확화
  • Chores

    • 배포 환경 및 사용자 관리 설정 업데이트
    • 디스코드 알림 기능 추가

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

운영 서버 배포를 위한 통합 설정을 수행합니다. 새로운 Jenkins 파이프라인을 추가하고, Dockerfile의 실행 사용자를 변경하며, 프로덕션 프로필에 대한 OAuth 및 Sentry 설정을 추가하고, EC2 배포 워크플로우를 수정합니다.

Changes

분류 / 파일(들) 변경 요약
CI/CD 워크플로우
.github/workflows/dev-cd.yml
EC2 배포 단계의 Docker 실행 명령에 SPRING_PROFILES_ACTIVE=dev 환경 변수 추가
Jenkins 파이프라인
Jenkinsfile
새로운 Jenkins 파이프라인 정의: GitHub 체크아웃, Git SHA 추출, 자격증명 로드, Gradle 빌드, Docker 이미지 빌드 및 푸시, SSH를 통한 운영 환경 블루/그린 배포, Discord 알림 및 정리 작업 포함
Docker 구성
Dockerfile
실행 사용자를 noonddu에서 nuntteo로 변경, 사용자/그룹 ID 업데이트, JAR 소유권 변경, 엔트리포인트에서 dev 프로필 제거 후 일반 java -jar 실행으로 전환
프로덕션 설정
src/main/resources/oauth.yml, src/main/resources/sentry.yml
oauth.yml: prod 프로필에 Google(Android/iOS), Apple 클라이언트 ID 및 Google Sheets 범위(알람 삭제 이유-운영!A:C) 추가; sentry.yml: dev와 prod 프로필의 traces-sample-rate를 1.0에서 0.3으로 변경

Sequence Diagram(s)

sequenceDiagram
    actor Dev as 개발자
    participant Git as GitHub
    participant Jenkins as Jenkins
    participant Gradle as Gradle
    participant Docker as Docker Registry
    participant SSH as SSH
    participant Prod as 운영 서버

    Dev->>Git: 코드 푸시
    Git->>Jenkins: 파이프라인 트리거
    
    Jenkins->>Git: 1. 코드 체크아웃
    activate Jenkins
    Jenkins->>Jenkins: 2. Git SHA 추출
    
    rect rgb(200, 220, 255)
    Note over Jenkins: 자격증명 로드 & 구성 생성
    Jenkins->>Jenkins: 3. 시크릿 로드 (DockerHub, Google/Firebase 키)
    Jenkins->>Jenkins: 4. env.properties, google.json 생성
    end
    
    Jenkins->>Gradle: 5. Gradle bootJar 빌드
    activate Gradle
    Gradle-->>Jenkins: JAR 생성
    deactivate Gradle
    
    Jenkins->>Docker: 6. Docker 이미지 빌드 & 푸시 (SHORT_SHA 태그)
    activate Docker
    Docker-->>Jenkins: 이미지 푸시 완료
    deactivate Docker
    
    rect rgb(220, 255, 220)
    Note over Jenkins,Prod: 배포 단계
    Jenkins->>SSH: 7. blue/green 배포 스크립트 실행 (SSH)
    activate SSH
    SSH->>Prod: 배포 명령 전송
    Prod-->>SSH: 배포 완료
    deactivate SSH
    end
    
    rect rgb(255, 240, 220)
    Note over Jenkins: 사후 처리 (항상 실행)
    Jenkins->>Jenkins: 8. Discord 알림 (상태 기반 색상)
    Jenkins->>Jenkins: 9. 정리 (docker logout)
    end
    deactivate Jenkins
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

주요 이유: 새로운 Jenkins 파이프라인의 CI/CD 로직 검증, Dockerfile의 사용자 변경에 따른 영향 범위 검토, 다중 프로필에 걸친 설정 파일 검증(oauth, sentry), 배포 자동화 흐름의 정확성 확인이 필요합니다.

Possibly related PRs

  • 개발 서버 CI/CD 파이프라인을 구축한다. #23: 배포 워크플로우와 Dockerfile 프로필 처리 변경 사항을 공유하며, 두 PR 모두 SPRING_PROFILES_ACTIVE=dev 설정 방식을 다루고 있습니다(EC2 docker run 환경 변수 vs. Dockerfile 엔트리포인트).
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/#73-prod-deploy-setting

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4767a0 and 994eec2.

📒 Files selected for processing (5)
  • .github/workflows/dev-cd.yml (1 hunks)
  • Dockerfile (1 hunks)
  • Jenkinsfile (1 hunks)
  • src/main/resources/oauth.yml (1 hunks)
  • src/main/resources/sentry.yml (2 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@strongmhk strongmhk merged commit fb6e033 into develop Oct 19, 2025
0 of 2 checks passed
@strongmhk strongmhk deleted the chore/#73-prod-deploy-setting branch October 20, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

운영 서버 배포를 위한 설정을 한다.

1 participant