webhook 자동 배포 설정
This commit is contained in:
24
script/deploy.sh
Normal file
24
script/deploy.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
SRC="/repo"
|
||||
DST="/runtime"
|
||||
|
||||
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"
|
||||
Reference in New Issue
Block a user