fix(cd): 배포 스크립트 내 JSON 환경변수 파싱 오류 수정#271
Merged
jsoonworld merged 2 commits intodevelopfrom Jul 3, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
The PR updates the staging deployment workflow to improve robustness by halting on errors and ensuring secrets are passed correctly to the Docker container.
- Added
set -eto stop the script on any failure - Wrapped the
SPRING_DATASOURCE_PASSWORDsecret in single quotes to avoid shell parsing errors - Cleaned up and organized comments in the deployment script
| @@ -103,7 +102,7 @@ jobs: | |||
| -e SPRING_PROFILES_ACTIVE=staging \ | |||
| -e SPRING_DATASOURCE_URL='${{ secrets.DB_URL }}' \ | |||
| -e SPRING_DATASOURCE_USERNAME=${{ secrets.DB_USERNAME }} \ | |||
There was a problem hiding this comment.
Wrap the SPRING_DATASOURCE_USERNAME value in single quotes (e.g., -e SPRING_DATASOURCE_USERNAME='${{ secrets.DB_USERNAME }}') to maintain consistency and prevent potential shell parsing issues with special characters.
Suggested change
| -e SPRING_DATASOURCE_USERNAME=${{ secrets.DB_USERNAME }} \ | |
| -e SPRING_DATASOURCE_USERNAME='${{ secrets.DB_USERNAME }}' \ |
Member
Author
There was a problem hiding this comment.
SPRING_DATASOURCE_USERNAME 변수에도 일관성을 위해 작은따옴표를 추가하는 것이 좋다는 의견에 동의합니다. 잠재적인 파싱 오류를 방지하는 좋은 습관이기도 하니 제안해주신 대로 수정하겠습니다.
꼼꼼한 리뷰 감사합니다!
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.
📄 Work Description
문제점
GitHub Actions의 ssh-action을 통해 배포 스크립트를 실행할 때, 여러 줄로 구성된
FIREBASE_SERVICE_KEY_JSON시크릿이 따옴표로 보호되지 않아 셸(shell) 파싱 오류를 일으켰습니다.이로 인해
docker run명령어가 비정상적으로 중단되어 컨테이너가 제대로 실행되지 못했고, 결국 헬스 체크 단계에서 실패했습니다.해결 방안
docker run명령어의-e옵션에서FIREBASE_SERVICE_KEY_JSON변수를 작은따옴표(' ')로 감싸, 해당 시크릿 값이 하나의 완전한 문자열로 전달되도록 수정했습니다.또한, 배포 스크립트의 안정성을 위해 'set -e' 옵션을 유지하고 포트 확인 및 컨테이너 정리 로직을 개선했습니다.