27 lines
672 B
Bash
27 lines
672 B
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
SRC="/repo"
|
|
DST="/runtime"
|
|
|
|
git config --global --add safe.directory "$SRC"
|
|
|
|
cd "$SRC"
|
|
git fetch --all --prune
|
|
git pull --ff-only
|
|
|
|
# 릴리즈 백업(롤백용): 아래 5번과 연결
|
|
TAG="$(date +%Y%m%d-%H%M%S)"
|
|
mkdir -p "$DST/.releases/$TAG"
|
|
rsync -a --delete \
|
|
--exclude ".releases" \
|
|
"$DST/" "$DST/.releases/$TAG/"
|
|
|
|
# 소스 → 운영 반영 (네가 이미 만든 deploy-nas.sh가 있으면 그걸 호출해도 됨)
|
|
# 예: repo/scripts/deploy-nas.sh가 운영으로 복사/동기화하는 로직이라면:
|
|
bash "$SRC/scripts/deploy-nas.sh"
|
|
|
|
cd "$DST"
|
|
docker-compose up -d --build backend travel-proxy frontend
|
|
echo "DEPLOY_OK $TAG"
|