53 cd 서버 변경#56
Hidden character warning
Conversation
Merge pull request #54 from EscapeFrame/53-cd-서버-변경
WalkthroughCI/CD 워크플로우(.github/workflows/Spring-develop-CD.yml)에서 빌드 산출물 이름 변경 작업을 반영했습니다. 주석 한 줄이 추가되었고, 빌드 결과물을 CLUE-CD.jar에서 cd.jar로 변경하는 단계가 수정되었습니다. 이후 SCP 업로드 및 배포 단계는 기존대로 cd.jar를 참조합니다. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
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
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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.
📒 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 |
There was a problem hiding this comment.
와일드카드 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.
| 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.
서버 실행 안됨 오류 수정
Summary by CodeRabbit