Makefile de déploiement local
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
05c3934b28
commit
6af0bbe0c0
1 file changed
+24
@@ -0,0 +1,24 @@
|
|||||||
|
DEPLOY_DIR ?= /var/www/logs_reader
|
||||||
|
SERVICE ?= logs_reader
|
||||||
|
|
||||||
|
.PHONY: build deploy status logs
|
||||||
|
|
||||||
|
## Compile le binaire et les fichiers statiques en release.
|
||||||
|
build:
|
||||||
|
cargo leptos build --release
|
||||||
|
|
||||||
|
## Installe la nouvelle version dans $(DEPLOY_DIR) et redémarre le service.
|
||||||
|
deploy: build
|
||||||
|
install -m 755 target/release/logs_reader $(DEPLOY_DIR)/logs_reader
|
||||||
|
rsync -a --delete target/site/ $(DEPLOY_DIR)/site/
|
||||||
|
systemctl --user restart $(SERVICE)
|
||||||
|
@for i in $$(seq 1 50); do \
|
||||||
|
curl -sf -o /dev/null http://127.0.0.1:3100/ && echo "Déployé : http://logs-reader.loc" && exit 0; \
|
||||||
|
sleep 0.1; \
|
||||||
|
done; echo "Le service ne répond pas : make logs" >&2; exit 1
|
||||||
|
|
||||||
|
status:
|
||||||
|
systemctl --user status $(SERVICE) --no-pager
|
||||||
|
|
||||||
|
logs:
|
||||||
|
journalctl --user -u $(SERVICE) -f
|
||||||
Reference in new issue
Block a user