Files
task-inventory/Makefile
mikael-lovqvists-claude-agent 71fb7aee55 Move chown -R into sync target so it always runs
rsync --chown only applies to transferred files; a separate chown -R
ensures ownership is correct even when no files needed updating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 21:58:45 +00:00

21 lines
601 B
Makefile

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 -u $(OWNER_USER) npm ci --prefix $(DEST)
# Copy files and fix ownership — useful for quick updates when dependencies haven't changed
sync:
sudo rsync -a --delete --chown=$(OWNER) $(RSYNC_EXCLUDES) ./ $(DEST)/
sudo chown -R $(OWNER) $(DEST)