37 lines
1.0 KiB
Bash
37 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# deployer 컨테이너 내부에서는 /repo, /runtime 사용
|
|
# 호스트 수동 실행 시에는 환경변수($REPO_PATH, $RUNTIME_PATH) 또는 아래 기본값 사용
|
|
SRC="${REPO_PATH:-/repo}"
|
|
DST="${RUNTIME_PATH:-/runtime}"
|
|
|
|
cd "$SRC"
|
|
|
|
# 레포에서 운영으로 반영할 항목들만 복사/동기화 (필요한 것만 적기)
|
|
# backend, travel-proxy, deployer, nginx, scripts, docker-compose.yml, .env 등
|
|
rsync -a --delete \
|
|
--exclude ".git" \
|
|
--exclude ".releases" \
|
|
"$SRC/backend/" "$DST/backend/"
|
|
rsync -a --delete \
|
|
--exclude ".git" \
|
|
"$SRC/travel-proxy/" "$DST/travel-proxy/"
|
|
rsync -a --delete \
|
|
--exclude ".git" \
|
|
"$SRC/deployer/" "$DST/deployer/"
|
|
rsync -a --delete \
|
|
--exclude ".git" \
|
|
"$SRC/nginx/" "$DST/nginx/"
|
|
rsync -a --delete \
|
|
--exclude ".git" \
|
|
"$SRC/scripts/" "$DST/scripts/"
|
|
|
|
# compose 파일 / env 파일
|
|
rsync -a "$SRC/docker-compose.yml" "$DST/docker-compose.yml"
|
|
if [ -f "$SRC/.env" ]; then
|
|
rsync -a "$SRC/.env" "$DST/.env"
|
|
fi
|
|
|
|
echo "SYNC_OK"
|