Skip to content

Conversation

@jsoonworld
Copy link
Member

📄 Work Description

  • 문제점
    GitHub Actions의 ssh-action을 통해 배포 스크립트를 실행할 때, 여러 줄로 구성된 FIREBASE_SERVICE_KEY_JSON 시크릿이 따옴표로 보호되지 않아 셸(shell) 파싱 오류를 일으켰습니다.
    이로 인해 docker run 명령어가 비정상적으로 중단되어 컨테이너가 제대로 실행되지 못했고, 결국 헬스 체크 단계에서 실패했습니다.

  • 해결 방안
    docker run 명령어의 -e 옵션에서 FIREBASE_SERVICE_KEY_JSON 변수를 작은따옴표(' ')로 감싸, 해당 시크릿 값이 하나의 완전한 문자열로 전달되도록 수정했습니다.
    또한, 배포 스크립트의 안정성을 위해 'set -e' 옵션을 유지하고 포트 확인 및 컨테이너 정리 로직을 개선했습니다.

@jsoonworld jsoonworld requested a review from Copilot July 3, 2025 04:06
@jsoonworld jsoonworld self-assigned this Jul 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 -e to stop the script on any failure
  • Wrapped the SPRING_DATASOURCE_PASSWORD secret in single quotes to avoid shell parsing errors
  • Cleaned up and organized comments in the deployment script

-p ${NEW_PORT}:8080 \
-e SPRING_PROFILES_ACTIVE=staging \
-e SPRING_DATASOURCE_URL='${{ secrets.DB_URL }}' \
-e SPRING_DATASOURCE_USERNAME=${{ secrets.DB_USERNAME }} \
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

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 }}' \

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

SPRING_DATASOURCE_USERNAME 변수에도 일관성을 위해 작은따옴표를 추가하는 것이 좋다는 의견에 동의합니다. 잠재적인 파싱 오류를 방지하는 좋은 습관이기도 하니 제안해주신 대로 수정하겠습니다.

꼼꼼한 리뷰 감사합니다!

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Jul 3, 2025
@jsoonworld jsoonworld merged commit 01f9ab2 into develop Jul 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants