From 416a76e9f005fcfc90f7355806d601cd7fe5838f Mon Sep 17 00:00:00 2001 From: Alexis Fourmaux Date: Fri, 8 May 2026 12:17:38 +0200 Subject: [PATCH] feat: add a makefile for single line deployment on rpi target --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6a18df4 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +IP ?= 192.168.1.195 +REMOTE_USER ?= pi +REMOTE = $(REMOTE_USER)@$(IP) +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' + +.PHONY: deploy + +deploy: + @echo "Déploiement sur $(REMOTE):$(DEST)" + ssh $(REMOTE) "mkdir -p $(DEST)" + rsync $(RSYNC_OPTS) . $(REMOTE):$(DEST) + @echo "Déploiement terminé" + ssh $(REMOTE) "cd $(DEST)/lora-gateway && docker compose up -d --force-recreate" + ssh $(REMOTE) "cd $(DEST)/app && docker compose up -d --force-recreate" + @echo "Services redémarrés" \ No newline at end of file