fix: 배포용 jar를 고정된 이름(app.jar)으로 복사해 선택 모호성 제거 - #205
Merged
Conversation
이전에는 deploy.sh가 /home/ec2-user/app/ 안의 여러 jar 파일 중 하나를 ls + grep(exclude 패턴)으로 "추측"해서 골랐음. 이 방식은 그 디렉토리에 새 jar 파일이 추가될 때마다(OTel agent jar 경로 변경 때 실제로 터졌던 문제) 깨질 수 있는 구조였음. CI(Copy Jar 단계)에서 실행 가능한 jar 하나만 골라 고정된 이름 app.jar로 복사하도록 변경. deploy.sh는 이제 $APP_DIR/app.jar 고정 경로만 참조해서 ls/grep으로 추측하는 과정 자체가 사라짐 — 앞으로 이 디렉토리에 어떤 파일이 추가돼도 배포 스크립트가 헷갈릴 여지가 없음.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
직전 배포(#204)가
deploy.sh의 jar 선택 로직(ls *.jar | grep -v plain | ...) 문제로 8080 프로세스 크래시를 일으켰음. OTel agent jar가 알파벳순으로 앱 jar보다 앞에 와서 잘못 선택된 것이 원인 —grep -v opentelemetry로 급한 불은 껐지만, 이건 exclude 패턴 방식이라 다른 새 파일이 추가되면 똑같은 문제가 재발할 수 있는 구조임.변경 내용
근본 원인(선택 모호성) 자체를 제거:
Copy Jar단계에서 실행 가능한 jar 하나만 골라 고정된 이름app.jar로 복사deploy.sh는 이제$APP_DIR/app.jar고정 경로만 참조 — ls/grep으로 "추측"하는 과정 자체가 사라짐이제
/home/ec2-user/app/디렉토리에 어떤 파일이 나중에 추가되더라도 배포 스크립트가 헷갈릴 여지가 없음.참고
기존에 깔려있던
server-0.0.1-SNAPSHOT.jar,server-0.0.1-SNAPSHOT-plain.jar는 이번 배포 후에도 정리 안 되고 남아있을 수 있음(CodeDeploy가 기존 파일을 자동으로 지우진 않음) — 동작에는 영향 없지만 원하면 별도로 정리 가능.