feat: add targets to clean deployment
This commit is contained in:
parent
1f4f64ea9a
commit
65804182ab
1 changed files with 18 additions and 2 deletions
20
Makefile
20
Makefile
|
|
@ -4,7 +4,7 @@ REMOTE = $(REMOTE_USER)@$(IP)
|
||||||
DEST ?= /home/$(REMOTE_USER)/projet-agreg
|
DEST ?= /home/$(REMOTE_USER)/projet-agreg
|
||||||
RSYNC_OPTS = -arvz --delete --exclude='__pycache__' --exclude='*.pyc' --exclude='.env' --exclude='.venv' --exclude='Makefile' --exclude='.git' --exclude='.vscode' --exclude='.gitignore'
|
RSYNC_OPTS = -arvz --delete --exclude='__pycache__' --exclude='*.pyc' --exclude='.env' --exclude='.venv' --exclude='Makefile' --exclude='.git' --exclude='.vscode' --exclude='.gitignore'
|
||||||
|
|
||||||
.PHONY: deploy
|
.PHONY: deploy deploy-gw deploy-app clean-app clean-gw clean-all
|
||||||
|
|
||||||
deploy-all: deploy-gw deploy-app
|
deploy-all: deploy-gw deploy-app
|
||||||
|
|
||||||
|
|
@ -22,4 +22,20 @@ deploy-gw:
|
||||||
rsync $(RSYNC_OPTS) lora-gateway $(REMOTE):$(DEST)
|
rsync $(RSYNC_OPTS) lora-gateway $(REMOTE):$(DEST)
|
||||||
@echo "Déploiement terminé"
|
@echo "Déploiement terminé"
|
||||||
ssh $(REMOTE) "cd $(DEST)/lora-gateway && docker compose up -d --force-recreate"
|
ssh $(REMOTE) "cd $(DEST)/lora-gateway && docker compose up -d --force-recreate"
|
||||||
@echo "Services redémarrés"
|
@echo "Services redémarrés"
|
||||||
|
|
||||||
|
clean-app:
|
||||||
|
@echo "Nettoyage de l'app sur $(REMOTE):$(DEST)/app"
|
||||||
|
ssh $(REMOTE) "cd $(DEST)/app && docker compose down --volumes --remove-orphans || true"
|
||||||
|
ssh $(REMOTE) "rm -rf $(DEST)/app"
|
||||||
|
@echo "Nettoyage de l'application terminé"
|
||||||
|
|
||||||
|
clean-gw:
|
||||||
|
@echo "Nettoyage de la gateway sur $(REMOTE):$(DEST)/lora-gateway"
|
||||||
|
ssh $(REMOTE) "cd $(DEST)/lora-gateway && docker compose down --volumes --remove-orphans || true"
|
||||||
|
ssh $(REMOTE) "rm -rf $(DEST)/lora-gateway"
|
||||||
|
@echo "Nettoyage de la gateway terminé"
|
||||||
|
|
||||||
|
clean-all: clean-app clean-gw
|
||||||
|
ssh $(REMOTE) "docker system prune -f || true"
|
||||||
|
@echo "Nettoyage complet terminé"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue