-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Dev #57
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
환경 변수 검증 및 에러 처리 추가를 권장합니다.
현재 구현은
SERVER_YML환경 변수가 존재하지 않거나, 비어있거나, 잘못된 base64 인코딩일 경우에도 빌드가 계속 진행됩니다. 이는 다음과 같은 문제를 야기할 수 있습니다:CI/CD 파이프라인에서는 "조용히 실패"하는 것보다 "명시적으로 실패"하는 것이 훨씬 안전합니다. 문제를 조기에 발견할수록 수정 비용이 낮아지기 때문입니다.
🔎 권장 개선안: 환경 변수 검증 및 에러 처리 추가
옵션 1 (권장): 환경 변수 존재 여부 사전 검증
pre_build: commands: - echo "⚙️ [Pre Build Phase] 환경파일 생성 시작" - mkdir -p src/main/resources/firebase + - | + if [ -z "$SECRET_YML" ] || [ -z "$SERVER_YML" ]; then + echo "❌ 필수 환경 변수가 설정되지 않았습니다." + [ -z "$SECRET_YML" ] && echo " - SECRET_YML is not set" + [ -z "$SERVER_YML" ] && echo " - SERVER_YML is not set" + exit 1 + fi - echo "$SECRET_YML" | base64 -d > src/main/resources/application-secret.yml - echo "$SERVER_YML" | base64 -d > src/main/resources/application-server.yml - echo "$FIREBASE_ADMINSDK_ACCOUNT_KEY" > src/main/resources/firebase/firebase-adminsdk-account.json - echo "✅ [Pre Build Phase] 완료"장점:
단점:
옵션 2: 각 명령어에 개별 검증 추가
장점:
단점:
옵션 3: 파일 생성 후 검증
- echo "$SECRET_YML" | base64 -d > src/main/resources/application-secret.yml - echo "$SERVER_YML" | base64 -d > src/main/resources/application-server.yml - echo "$FIREBASE_ADMINSDK_ACCOUNT_KEY" > src/main/resources/firebase/firebase-adminsdk-account.json + - | + for file in application-secret.yml application-server.yml; do + if [ ! -s "src/main/resources/$file" ]; then + echo "❌ $file 파일이 비어있거나 생성되지 않았습니다." + exit 1 + fi + done - echo "✅ [Pre Build Phase] 완료"장점:
단점:
개인적으로는 옵션 1을 권장합니다. 사전 검증은 "fail fast" 원칙에 부합하며, 디버깅이 가장 쉽기 때문입니다.
🤖 Prompt for AI Agents