Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ jobs:
cd ~/snackgame-server/repo
git fetch origin dev
git checkout dev
git pull origin dev
git pull origin dev --no-recurse-submodules
chmod +x scripts/deploy-dev.sh
scripts/deploy-dev.sh
4 changes: 2 additions & 2 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
cd ~/snackgame-server/repo
git fetch origin main
git checkout main
git pull origin main
git pull origin main --no-recurse-submodules
chmod +x scripts/deploy-rolling.sh
scripts/deploy-rolling.sh \
${{ secrets.NLB_BACKEND_02_HTTP }} \
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
cd ~/snackgame-server/repo
git fetch origin main
git checkout main
git pull origin main
git pull origin main --no-recurse-submodules
chmod +x scripts/deploy-rolling.sh
scripts/deploy-rolling.sh \
${{ secrets.NLB_BACKEND_01_HTTP }} \
Expand Down
5 changes: 2 additions & 3 deletions scripts/deploy-rolling.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

set -euo pipefail


if [ $# -ne 2 ]; then
echo "Usage: $0 <http-backend-name> <https-backend-name>"
exit 1
Expand All @@ -11,6 +10,8 @@ HTTP_BACKEND="$1"
HTTPS_BACKEND="$2"


export PATH="$HOME/bin:$PATH"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

OCI CLI 경로를 PATH에 추가할 때, 스크립트가 sudo 권한으로 실행될 경우 $HOME 변수가 /root로 평가되어 일반 사용자 디렉토리(예: /home/ubuntu/bin)에 설치된 oci 명령어를 찾지 못할 수 있습니다. 배포 환경에서 sudo 사용 여부를 확인해 주시고, 가급적 절대 경로를 사용하거나 command -v oci를 통해 명령어 존재 여부를 검증하는 로직을 추가하는 것을 권장합니다.


COMPOSE_DIR="$HOME/snackgame-server"
HEALTH_CHECK_URL="http://localhost:8080/rankings/1?by=BEST_SCORE"
HEALTH_CHECK_TIMEOUT=120
Expand Down Expand Up @@ -78,7 +79,6 @@ wait_healthy() {
return 1
}


rollback() {
echo "[롤백] 이전 컨테이너로 복구 중..."
cd "$COMPOSE_DIR"
Expand All @@ -88,7 +88,6 @@ rollback() {
exit 1
}


echo "======================================"
echo "[배포 시작]"
echo "[대상] HTTP=$HTTP_BACKEND, HTTPS=$HTTPS_BACKEND"
Expand Down
Loading