Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/DOCKER-CD-STAGING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
jobs:
ci:
runs-on: ubuntu-24.04

steps:
# 1. 소스 코드 체크아웃
- name: Checkout
Expand Down Expand Up @@ -55,7 +54,6 @@ jobs:
needs: ci
runs-on: ubuntu-24.04
environment: staging

steps:
- name: Deploy to Staging Server
uses: appleboy/ssh-action@master
Expand All @@ -64,13 +62,15 @@ jobs:
username: ${{ secrets.STAGING_SERVER_USER }}
key: ${{ secrets.STAGING_SERVER_KEY }}
script: |
# 오류 발생 시 즉시 스크립트 중단
set -e

# --- 변수 설정 ---
APP_NAME="terning2025-staging"
IMAGE_NAME="terningpoint/terning2025-staging"
NGINX_CONFIG_PATH="/etc/nginx"
SERVICE_URL_INC_PATH="${NGINX_CONFIG_PATH}/conf.d/service-url-staging.inc"

echo "### 1. 최신 Docker 이미지를 pull합니다."
docker pull ${IMAGE_NAME}:latest

Expand All @@ -87,7 +87,6 @@ jobs:
OLD_CONTAINER_NAME="${APP_NAME}-8081"
fi

# 최초 배포인지 확인
if [ -z "$IS_BLUE_RUNNING" ] && [ -z "$(docker ps -q --filter "name=${APP_NAME}" --filter "publish=8081")" ]; then
echo " > 현재 실행중인 서비스가 없습니다. 최초 배포를 시작합니다."
echo " > 새로 실행할 포트(Green): ${NEW_PORT}"
Expand All @@ -103,7 +102,7 @@ jobs:
-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
Copy Markdown
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 변수에도 일관성을 위해 작은따옴표를 추가하는 것이 좋다는 의견에 동의합니다. 잠재적인 파싱 오류를 방지하는 좋은 습관이기도 하니 제안해주신 대로 수정하겠습니다.

꼼꼼한 리뷰 감사합니다!

-e SPRING_DATASOURCE_PASSWORD=${{ secrets.DB_PASSWORD }} \
-e SPRING_DATASOURCE_PASSWORD='${{ secrets.DB_PASSWORD }}' \
-e SPRING_JPA_DEFAULT_SCHEMA=${{ secrets.SPRING_JPA_DEFAULT_SCHEMA }} \
-e JWT_SECRET_KEY='${{ secrets.JWT_SECRET_KEY }}' \
-e JWT_ACCESS_TOKEN_EXPIRED=${{ secrets.JWT_ACCESS_TOKEN_EXPIRED }} \
Expand Down
Loading