feat: add a makefile for single line deployment on rpi target
This commit is contained in:
parent
851e8947bc
commit
416a76e9f0
1 changed files with 16 additions and 0 deletions
16
Makefile
Normal file
16
Makefile
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue