feat: add a makefile for single line deployment on rpi target

This commit is contained in:
Alexis Fourmaux 2026-05-08 12:17:38 +02:00
parent 851e8947bc
commit 416a76e9f0

16
Makefile Normal file
View file

@ -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"