Skip to content

Comments

[fix] 서버 이전으로 인한 CI/CD 변경사항 적용#349

Merged
Due-IT merged 4 commits intodevelop/befrom
fix/#346-fix_cicd
Apr 29, 2025
Merged

[fix] 서버 이전으로 인한 CI/CD 변경사항 적용#349
Due-IT merged 4 commits intodevelop/befrom
fix/#346-fix_cicd

Conversation

@PororoAndFriends
Copy link
Collaborator

@PororoAndFriends PororoAndFriends commented Apr 28, 2025

#️⃣연관된 이슈

ex) #346

📝작업 내용

서버 이전으로 인한 CI/CD 변경사항 적용
인스턴스 유저에 대한 추가적인 변수명을 도입하여 코드를 변경하지 않고 변경사항이 적용될 수 있게끔 수정
VM 내의 파일 정보들 수정 및 테스트

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • Chores
    • 배포 워크플로우에서 사용자 디렉토리 경로를 하드코딩에서 비밀 변수로 변경하여 유연성을 개선했습니다.
    • 배포 스크립트 실행 시 USERNAME 환경 변수를 추가로 설정하도록 수정했습니다.

@PororoAndFriends PororoAndFriends self-assigned this Apr 28, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 28, 2025

Walkthrough

GitHub Actions 워크플로우 파일 두 곳에서 배포 스크립트 실행 시 하드코딩된 사용자 디렉터리 경로(/home/g11_27_proro/…)를 비밀 변수(${{ secrets.GCE_INSTANCE_USER }})를 사용하는 동적 경로로 변경하였다. 또한, 배포 스크립트 실행 전 USERNAME 환경 변수를 추가로 설정하여 Docker Compose 등에서 활용할 수 있도록 하였다. 워크플로우 트리거 브랜치에는 fix/#346-fix_cicd가 추가되었다.

Changes

파일 경로 변경 요약
.github/workflows/server_cd_develop.yml
.github/workflows/server_cd_release.yml
서비스 계정 키 파일 및 배포 스크립트 경로를 하드코딩에서 비밀 변수 기반 동적 경로로 변경.
USERNAME 환경 변수 추가.
워크플로우 트리거 브랜치에 fix/#346-fix_cicd 추가(개발 워크플로우 한정).

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant GCE Instance

    GitHub Actions->>GCE Instance: gcloud auth activate-service-account (동적 경로 사용)
    GitHub Actions->>GCE Instance: docker login
    GitHub Actions->>GCE Instance: docker pull
    GitHub Actions->>GCE Instance: chmod +x deploy.sh (동적 경로 사용)
    GitHub Actions->>GCE Instance: USERNAME 환경 변수 설정
    GitHub Actions->>GCE Instance: ./deploy.sh 실행 (동적 경로 사용)
    GitHub Actions->>GCE Instance: docker image prune
Loading

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

Test Results

1 tests   1 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 5bca61f.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (3)
.github/workflows/server_cd_develop.yml (1)

114-114: 디테일: 불필요한 공백 제거 권장
YAMLLint에서 감지된 트레일링 스페이스(줄 끝 공백)가 발생하고 있습니다. 해당 빈 줄의 후행 공백을 제거해 주세요.

Also applies to: 117-117, 119-119

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 114-114: trailing spaces

(trailing-spaces)

.github/workflows/server_cd_release.yml (2)

113-113: 디테일: 불필요한 공백 제거 권장
YAMLLint에서 감지된 트레일링 스페이스(줄 끝 공백)가 발생하고 있습니다. 해당 빈 줄의 후행 공백을 제거해 주세요.

Also applies to: 116-116, 118-118

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 113-113: trailing spaces

(trailing-spaces)


1-126: 중복 워크플로우 요소 리팩터 제안
두 워크플로우에서 거의 동일한 배포 단계가 반복되고 있습니다. 재사용 가능한 composite workflow나 reusable job으로 추출하여 DRY 원칙에 맞게 관리하면 유지보수 비용을 줄일 수 있습니다.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 93-93: trailing spaces

(trailing-spaces)


[error] 113-113: trailing spaces

(trailing-spaces)


[error] 116-116: trailing spaces

(trailing-spaces)


[error] 118-118: trailing spaces

(trailing-spaces)


[error] 123-123: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7db530b and 5bca61f.

📒 Files selected for processing (2)
  • .github/workflows/server_cd_develop.yml (2 hunks)
  • .github/workflows/server_cd_release.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/server_cd_release.yml

[error] 113-113: trailing spaces

(trailing-spaces)


[error] 116-116: trailing spaces

(trailing-spaces)


[error] 118-118: trailing spaces

(trailing-spaces)

.github/workflows/server_cd_develop.yml

[error] 114-114: trailing spaces

(trailing-spaces)


[error] 117-117: trailing spaces

(trailing-spaces)


[error] 119-119: trailing spaces

(trailing-spaces)

🔇 Additional comments (7)
.github/workflows/server_cd_develop.yml (4)

8-9: 동적 브랜치 트리거 적용 확인
’fix/#346-fix_cicd’ 브랜치를 단일 인용부호로 감싸서 # 문자가 그대로 인식되도록 처리했습니다. 의도한 대로 해당 브랜치에서 워크플로우가 실행되는지 확인하세요.


113-113: 서비스 계정 키 경로 동적 변수화 완료
하드코딩된 /home/g11_27_proro/… 경로를 ${{ secrets.GCE_INSTANCE_USER }}로 대체해 유연성을 확보했습니다.


120-120: 환경 변수 USERNAME 설정 추가
Docker Compose 파일에서 사용할 USERNAME 환경 변수를 SSH 내부 스크립트에 주입했습니다.


122-123: 배포 스크립트 실행 권한 부여 및 호출
sudo chmod +xsudo -E 옵션을 통해 환경 변수를 유지하며 deploy.sh를 실행하도록 개선했습니다.

.github/workflows/server_cd_release.yml (3)

113-113: 서비스 계정 키 경로 동적 변수화 완료
하드코딩된 /home/g11_27_proro/… 경로를 ${{ secrets.GCE_INSTANCE_USER }}로 대체해 유연성을 확보했습니다.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 113-113: trailing spaces

(trailing-spaces)


119-119: 환경 변수 USERNAME 설정 추가
Docker Compose 파일에서 사용할 USERNAME 환경 변수를 SSH 내부 스크립트에 주입했습니다.


121-122: 배포 스크립트 실행 권한 부여 및 호출
sudo chmod +xsudo -E 옵션을 통해 환경 변수를 유지하며 deploy.sh를 실행하도록 개선했습니다.

Copy link
Member

@Zepelown Zepelown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

Copy link
Collaborator

@Due-IT Due-IT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍

@Due-IT Due-IT merged commit 8eed6f9 into develop/be Apr 29, 2025
5 checks passed
@PororoAndFriends PororoAndFriends deleted the fix/#346-fix_cicd branch May 3, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants