Skip to content

[EDMT-437] 포트 Switch 단계에 nginx 컨테이너 실행 보장 로직 추가#68

Merged
wldks1008 merged 2 commits into
developfrom
fix/EDMT-437
Sep 20, 2025
Merged

[EDMT-437] 포트 Switch 단계에 nginx 컨테이너 실행 보장 로직 추가#68
wldks1008 merged 2 commits into
developfrom
fix/EDMT-437

Conversation

@wldks1008

@wldks1008 wldks1008 commented Sep 20, 2025

Copy link
Copy Markdown
Member

📣 Jira Ticket

EDMT-437

👩‍💻 작업 내용

포트 Switch 단계에 nginx 컨테이너 실행 보장 로직 추가

Summary by CodeRabbit

  • 신규 기능
    • 없음
  • 버그 수정
    • 배포 시 nginx가 실행 중이 아니어도 자동 기동 후 업스트림 전환 및 재로드를 수행하도록 개선.
    • 활성 앱(블루/그린)에 따른 새 타깃 계산과 서비스 URL 갱신, 설정 검사 후 안전한 재로드 적용.
    • 개발·프로덕션 환경 모두에 반영되어 배포 신뢰성 향상 및 다운타임 위험 감소.
  • 작업(Chores)
    • 배포 워크플로우의 회복력 및 일관성 강화.

@wldks1008 wldks1008 self-assigned this Sep 20, 2025
@coderabbitai

coderabbitai Bot commented Sep 20, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

배포 워크플로우의 nginx 업스트림 전환 단계에 실행 가드가 추가되었고, 활성 앱(blue/green)에 따라 NEW_TARGET을 계산한 뒤 service-url.inc를 갱신하고 nginx 설정 테스트 및 리로드를 수행합니다. dev/prod CD 모두 nginx 컨테이너 미실행 시 docker-compose로 기동하도록 보강되었습니다.

Changes

Cohort / File(s) Summary
Dev CD 워크플로우
.github/workflows/api-dev-cd.yml
“Switch nginx upstream and reload” 단계에 nginx 컨테이너 실행 확인 및 필요 시 docker-compose로 기동 로직 추가. 활성 앱에 기반한 NEW_TARGET 계산 유지, service-url.inc 갱신 후 테스트 및 리로드 수행.
Prod CD 워크플로우
.github/workflows/api-prod-cd.yml
업스트림 전환 단계 로직을 가드형으로 재구성: nginx 실행 확인/기동, NEW_TARGET 계산, service-url.inc 쓰기, 설정 테스트 및 즉시 리로드. 기존 묵시적 전제 제거.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions (dev/prod CD)
  participant SSH as Remote Host
  participant NG as nginx Container
  participant DC as docker-compose

  GH->>SSH: 배포 단계 실행
  SSH->>SSH: 활성 앱 확인 (blue/green) → NEW_TARGET 계산
  SSH->>NG: 상태 확인 (실행 중?)
  alt nginx 미실행
    SSH->>DC: docker-compose up -d nginx
    DC-->>SSH: nginx 기동
  else nginx 실행 중
    Note over SSH,NG: 그대로 진행
  end
  SSH->>NG: /etc/nginx/conf.d/service-url.inc 갱신
  SSH->>NG: nginx -t (설정 테스트)
  NG-->>SSH: 테스트 결과
  SSH->>NG: nginx -s reload (리로드)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

🛠️ fix 🛠️

Suggested reviewers

  • TaegeunYou

Poem

푸른 파도, 초록 풀밭, 배포의 춤을 춘다 🐇
업스트림 살짝 틀고, nginx야 깨어나라!
NEW_TARGET 콕 집어, 길 안내 쓱 고쳐주고,
설정 테스트 통과! 바람처럼 리로드—슝.
오늘도 배포밭에 당근 한 묶음 추가 🥕

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/EDMT-437

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e2b614 and 534302c.

📒 Files selected for processing (2)
  • .github/workflows/api-dev-cd.yml (1 hunks)
  • .github/workflows/api-prod-cd.yml (1 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

@wldks1008 wldks1008 changed the title [EDMT-437] [EDMT-437] 포트 Switch 단계에 nginx 컨테이너 실행 보장 로직 추가 Sep 20, 2025
@wldks1008 wldks1008 merged commit 815a163 into develop Sep 20, 2025
1 of 2 checks passed
@wldks1008 wldks1008 deleted the fix/EDMT-437 branch September 20, 2025 04:13
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