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
|
||||
GIT_REMOTE := origin
|
||||
|
||||
# rsync: was NICHT auf die DS übertragen wird
|
||||
RSYNC_EXCLUDE := --exclude='.git' \
|
||||
--exclude='data/' \
|
||||
--exclude='backend/venv/' \
|
||||
--exclude='backend/__pycache__/' \
|
||||
--exclude='backend/*.pyc' \
|
||||
--exclude='.env' \
|
||||
--exclude='*.db' \
|
||||
--exclude='.DS_Store'
|
||||
# tar: was NICHT auf die DS übertragen wird
|
||||
TAR_EXCLUDE := --exclude='.git' \
|
||||
--exclude='./data' \
|
||||
--exclude='./backend/venv' \
|
||||
--exclude='./backend/__pycache__' \
|
||||
--exclude='./.env' \
|
||||
--exclude='./*.db' \
|
||||
--exclude='./.DS_Store'
|
||||
|
||||
.PHONY: help deploy sync push restart build stop status \
|
||||
logs logs-f shell db dev clean-cache check-ssh
|
||||
|
|
@ -72,8 +71,7 @@ deploy: check-ssh
|
|||
@echo "→ Git push (Backup)..."
|
||||
@git push $(GIT_REMOTE) main
|
||||
@echo "→ Sync zu DS..."
|
||||
@rsync -az --delete $(RSYNC_EXCLUDE) \
|
||||
./ $(DS_HOST):$(DS_PATH)/
|
||||
@tar czf - $(TAR_EXCLUDE) . | ssh $(DS_HOST) "tar xzf - -C $(DS_PATH)/"
|
||||
@echo "→ Docker rebuild + restart..."
|
||||
@ssh $(DS_HOST) " \
|
||||
cd $(DS_PATH) && \
|
||||
|
|
@ -91,8 +89,7 @@ deploy: check-ssh
|
|||
# ----------------------------------------------------------
|
||||
sync: check-ssh
|
||||
@echo "→ Sync zu DS..."
|
||||
@rsync -az --delete $(RSYNC_EXCLUDE) \
|
||||
./ $(DS_HOST):$(DS_PATH)/
|
||||
@tar czf - $(TAR_EXCLUDE) . | ssh $(DS_HOST) "tar xzf - -C $(DS_PATH)/"
|
||||
@echo " ✓ Sync fertig."
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue