Add Makefile with deploy target
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
20
Makefile
Normal file
20
Makefile
Normal file
@@ -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)/
|
||||
Reference in New Issue
Block a user