Skip to content

53 cd 서버 변경#56

Merged
fixgramwork merged 3 commits intodevelopfrom
53-cd-서버-변경
Aug 30, 2025

Hidden character warning

The head ref may contain hidden characters: "53-cd-\uc11c\ubc84-\ubcc0\uacbd"
Merged

53 cd 서버 변경#56
fixgramwork merged 3 commits intodevelopfrom
53-cd-서버-변경

Conversation

@fixgramwork
Copy link
Member

@fixgramwork fixgramwork commented Aug 30, 2025

서버 실행 안됨 오류 수정

Summary by CodeRabbit

  • Chores
    • 배포 파이프라인에서 빌드 아티팩트 파일명을 cd.jar로 표준화해 업로드/배포 단계와의 일관성을 확보했습니다. 기능 변화나 사용자 영향은 없습니다.
  • Documentation
    • 워크플로 시작부에 식별용 주석을 추가해 구성의 가독성을 개선했습니다.

@coderabbitai
Copy link

coderabbitai bot commented Aug 30, 2025

Walkthrough

CI/CD 워크플로우(.github/workflows/Spring-develop-CD.yml)에서 빌드 산출물 이름 변경 작업을 반영했습니다. 주석 한 줄이 추가되었고, 빌드 결과물을 CLUE-CD.jar에서 cd.jar로 변경하는 단계가 수정되었습니다. 이후 SCP 업로드 및 배포 단계는 기존대로 cd.jar를 참조합니다.

Changes

Cohort / File(s) Change Summary
GitHub Actions CD Workflow
\.github/workflows/Spring-develop-CD.yml
상단 주석 추가, 빌드 산출물 이름 변경 단계에서 CLUE-CD.jarcd.jar로 수정. 이후 단계는 이미 cd.jar를 사용하므로 참조 일관화됨. 공개/내보내기 선언 변경 없음.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Bug/#38 #41 — 동일 워크플로우 파일에서 산출물 이름을 cd.jar로 정렬하는 변경으로 직접적으로 연관됨

Poem

새벽 파이프라인, 토끼는 깡총 뛰네
이름표 바꿔, cd.jar가 빛나네
바람처럼 복사, 서버로 살짝 착지
주석 한 줄 웃고, 배포는 그대로 가지
깡총—작지만 또렷한, 릴리즈의 리듬 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 53-cd-서버-변경

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

Copy link

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/Spring-develop-CD.yml (1)

4-8: PR가 “닫힘”이면 병합되지 않아도 배포됩니다 — 병합 여부 가드 필요

pull_request: types: [closed]는 “닫힘(미병합)”도 포함합니다. 미병합 PR로 배포되는 사고를 막기 위해 job 레벨 가드를 추가하세요.

 jobs:
   build:
+    if: ${{ github.event.pull_request.merged == true }}
@@
   deploy:
+    if: ${{ github.event.pull_request.merged == true }}

대안: 이벤트를 push: branches: [develop]로 바꿔 병합 커밋 기준으로 배포.

🧹 Nitpick comments (5)
.github/workflows/Spring-develop-CD.yml (5)

2-2: 오타: “Deplot” → “Deploy”

-name: Spring Deplot to EC2
+name: Spring Deploy to EC2

25-31: 비밀값 파일 생성 시 echo 대신 printf 사용 및 권한 제한(600) 권장

개행/이스케이프 문제를 줄이고 권한을 최소화하세요.

-      - name: application.properties 파일 설정
-        run: |
-          mkdir -p src/main/resources
-          mkdir -p src/test/resources
-          echo "${{ secrets.APPLICATION_PROPERTIES }}" > ./src/main/resources/application.properties
-          echo "${{ secrets.TEST_APPLICATION_PROPERTIES }}" > ./src/test/resources/application.properties
+      - name: application.properties 파일 설정
+        run: |
+          install -d -m 755 src/main/resources src/test/resources
+          install -m 600 /dev/null src/main/resources/application.properties
+          install -m 600 /dev/null src/test/resources/application.properties
+          printf "%s" "${{ secrets.APPLICATION_PROPERTIES }}" > src/main/resources/application.properties
+          printf "%s" "${{ secrets.TEST_APPLICATION_PROPERTIES }}" > src/test/resources/application.properties

35-36: gradlew 실행권한 문제 예방

리포에 따라 실행권한이 빠져 실패하는 경우가 있으므로 예방적으로 추가하는 것을 권장합니다.

-      - name: Build with Gradle Wrapper
-        run: ./gradlew clean build
+      - name: Build with Gradle Wrapper
+        run: |
+          chmod +x ./gradlew
+          ./gradlew clean build

41-49: 서드파티 GH Action 버전 고정 강화(서플라이 체인 보안)

appleboy/*-action@v0.1.7를 태그가 아닌 커밋 SHA로 pinning 하는 것을 권장합니다. gradle/actions처럼 SHA로 고정하면 무심코의 태그 재바인딩 리스크를 줄일 수 있습니다.

원하시면 해당 태그의 정확한 SHA를 찾아 적용 패치를 드리겠습니다.

Also applies to: 57-63


65-67: 상대 경로/권한 이슈 개선 및 프로세스 관리 제안

  • 배포 스크립트에서 절대 경로로 이동하면 작업 디렉토리 변동 리스크가 줄어듭니다.
  • sudo로 애플리케이션을 띄우면 루트 권한으로 동작/로그 파일 권한 문제가 발생할 수 있습니다. 가능하면 일반 사용자로 실행하거나 systemd로 관리하세요.
-            cd clue
-            sudo fuser -k -n tcp 8080 || true
-            sudo nohup java -jar cd.jar > ./output.log 2>&1 &
+            cd /home/ubuntu/clue
+            sudo fuser -k -n tcp 8080 || true
+            nohup java -jar cd.jar > ./output.log 2>&1 &

추가 제안:

  • 장기적으로는 systemd 유닛, 헬스체크, 롤백(이전 JAR 보존)까지 포함한 배포 스크립트로 개선을 권장합니다.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1fce561 and b14cbbd.

📒 Files selected for processing (1)
  • .github/workflows/Spring-develop-CD.yml (2 hunks)
🔇 Additional comments (1)
.github/workflows/Spring-develop-CD.yml (1)

1-1: 헤더 주석 추가는 OK

비기능 변경으로 문제 없습니다.


- name: 빌드된 파일 이름 변경하기
run: mv ./build/libs/*SNAPSHOT.jar ./CLUE-CD.jar
run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

와일드카드 mv가 여러 JAR에 매칭되면 실패하거나 잘못된 아티팩트를 선택할 수 있습니다

Spring Boot는 *-plain.jar도 생성합니다. 현재 패턴은 *-SNAPSHOT.jar 둘 다(일반/plain)를 매치할 수 있어 mv가 실패하거나 오작동합니다. 가장 최근의 non-plain JAR만 선택하도록 안전하게 변경하세요.

-        run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar
+        run: |
+          set -euo pipefail
+          ARTIFACT="$(ls -t ./build/libs/*.jar | grep -vE '(-plain|sources|javadoc)\.jar$' | head -n1)"
+          echo "Using artifact: $ARTIFACT"
+          mv "$ARTIFACT" ./cd.jar
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar
run: |
set -euo pipefail
ARTIFACT="$(ls -t ./build/libs/*.jar | grep -vE '(-plain|sources|javadoc)\.jar$' | head -n1)"
echo "Using artifact: $ARTIFACT"
mv "$ARTIFACT" ./cd.jar
🤖 Prompt for AI Agents
.github/workflows/Spring-develop-CD.yml around line 39: the mv uses a wildcard
that can match multiple jars (including *-plain.jar) causing failures or wrong
artifact selection; change the step to pick the most recent non-plain SNAPSHOT
JAR by listing build/libs sorted by modification time, filtering out files
matching "-plain.jar", selecting the first result, and moving that single file
to ./cd.jar so mv operates on exactly one artifact.

@fixgramwork fixgramwork merged commit 110d55a into develop Aug 30, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Sep 1, 2025
4 tasks
@fixgramwork fixgramwork deleted the 53-cd-서버-변경 branch November 19, 2025 06:49
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.

1 participant