Deploy: rsync → tar+ssh (kein rsync auf DS nötig)
This commit is contained in:
parent
43c63f0e59
commit
3547715555
2 changed files with 19 additions and 23 deletions
23
Makefile
23
Makefile
|
|
@ -11,15 +11,14 @@ DS_PATH := /volume1/docker/ban-yaro
|
||||||
CONTAINER := ban-yaro
|
CONTAINER := ban-yaro
|
||||||
GIT_REMOTE := origin
|
GIT_REMOTE := origin
|
||||||
|
|
||||||
# rsync: was NICHT auf die DS übertragen wird
|
# tar: was NICHT auf die DS übertragen wird
|
||||||
RSYNC_EXCLUDE := --exclude='.git' \
|
TAR_EXCLUDE := --exclude='.git' \
|
||||||
--exclude='data/' \
|
--exclude='./data' \
|
||||||
--exclude='backend/venv/' \
|
--exclude='./backend/venv' \
|
||||||
--exclude='backend/__pycache__/' \
|
--exclude='./backend/__pycache__' \
|
||||||
--exclude='backend/*.pyc' \
|
--exclude='./.env' \
|
||||||
--exclude='.env' \
|
--exclude='./*.db' \
|
||||||
--exclude='*.db' \
|
--exclude='./.DS_Store'
|
||||||
--exclude='.DS_Store'
|
|
||||||
|
|
||||||
.PHONY: help deploy sync push restart build stop status \
|
.PHONY: help deploy sync push restart build stop status \
|
||||||
logs logs-f shell db dev clean-cache check-ssh
|
logs logs-f shell db dev clean-cache check-ssh
|
||||||
|
|
@ -72,8 +71,7 @@ deploy: check-ssh
|
||||||
@echo "→ Git push (Backup)..."
|
@echo "→ Git push (Backup)..."
|
||||||
@git push $(GIT_REMOTE) main
|
@git push $(GIT_REMOTE) main
|
||||||
@echo "→ Sync zu DS..."
|
@echo "→ Sync zu DS..."
|
||||||
@rsync -az --delete $(RSYNC_EXCLUDE) \
|
@tar czf - $(TAR_EXCLUDE) . | ssh $(DS_HOST) "tar xzf - -C $(DS_PATH)/"
|
||||||
./ $(DS_HOST):$(DS_PATH)/
|
|
||||||
@echo "→ Docker rebuild + restart..."
|
@echo "→ Docker rebuild + restart..."
|
||||||
@ssh $(DS_HOST) " \
|
@ssh $(DS_HOST) " \
|
||||||
cd $(DS_PATH) && \
|
cd $(DS_PATH) && \
|
||||||
|
|
@ -91,8 +89,7 @@ deploy: check-ssh
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
sync: check-ssh
|
sync: check-ssh
|
||||||
@echo "→ Sync zu DS..."
|
@echo "→ Sync zu DS..."
|
||||||
@rsync -az --delete $(RSYNC_EXCLUDE) \
|
@tar czf - $(TAR_EXCLUDE) . | ssh $(DS_HOST) "tar xzf - -C $(DS_PATH)/"
|
||||||
./ $(DS_HOST):$(DS_PATH)/
|
|
||||||
@echo " ✓ Sync fertig."
|
@echo " ✓ Sync fertig."
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -60,18 +60,17 @@ ok "Verzeichnisse angelegt"
|
||||||
# 2. Dateien per rsync übertragen (kein git auf DS nötig)
|
# 2. Dateien per rsync übertragen (kein git auf DS nötig)
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
echo ""
|
echo ""
|
||||||
echo "→ Dateien übertragen (rsync)..."
|
echo "→ Dateien übertragen (tar+ssh)..."
|
||||||
|
|
||||||
rsync -az --delete \
|
cd "${ROOT}" && tar czf - \
|
||||||
--exclude='.git' \
|
--exclude='.git' \
|
||||||
--exclude='data/' \
|
--exclude='./data' \
|
||||||
--exclude='backend/venv/' \
|
--exclude='./backend/venv' \
|
||||||
--exclude='backend/__pycache__/' \
|
--exclude='./backend/__pycache__' \
|
||||||
--exclude='backend/*.pyc' \
|
--exclude='./.env' \
|
||||||
--exclude='.env' \
|
--exclude='./*.db' \
|
||||||
--exclude='*.db' \
|
--exclude='./.DS_Store' \
|
||||||
--exclude='.DS_Store' \
|
. | ssh "$DS_HOST" "tar xzf - -C '${DS_PATH}/'"
|
||||||
"${ROOT}/" "${DS_HOST}:${DS_PATH}/"
|
|
||||||
|
|
||||||
ok "Dateien übertragen"
|
ok "Dateien übertragen"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue