From 730be15b760577b1cb2cb59a824a034aa952a870 Mon Sep 17 00:00:00 2001 From: mikael-lovqvists-claude-agent Date: Sun, 17 May 2026 21:56:02 +0000 Subject: [PATCH] Add Makefile with deploy target Co-Authored-By: Claude Sonnet 4.6 --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cbf324a --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +DEST ?= /srv/task-inventory +OWNER ?= task-inventory:task-inventory +OWNER_USER = $(firstword $(subst :, ,$(OWNER))) + +RSYNC_EXCLUDES := \ + --exclude='/.git/' \ + --exclude='/data/' \ + --exclude='/config.yaml' \ + --exclude='/node_modules/' + +.PHONY: deploy sync + +# Full deployment: sync files, fix ownership, install dependencies +deploy: sync + sudo chown -R $(OWNER) $(DEST) + sudo -u $(OWNER_USER) npm ci --prefix $(DEST) + +# Copy files only — useful for quick updates when dependencies haven't changed +sync: + sudo rsync -a --delete $(RSYNC_EXCLUDES) ./ $(DEST)/