Update the `make deploy` target to tag the repo using the value returned by `website deployment next-tag`. Filter .DS_Store files from the public folder before rsyncing. This is a step the deploy script did.
44 lines
1.3 KiB
Makefile
44 lines
1.3 KiB
Makefile
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
BUILD_DIR=public
|
|
|
|
CONTENT_PATH=content
|
|
|
|
DEPLOY_USER=eryn
|
|
DEPLOY_HOSTNAME=nutmeg.erynwells.me
|
|
DEPLOY_PATH=/srv/www/erynwells.me/html
|
|
DEPLOY_LOCATION=$(DEPLOY_USER)@$(DEPLOY_HOSTNAME):$(DEPLOY_PATH)
|
|
|
|
HOSTNAME=$(shell hostname -s)
|
|
|
|
NETHACK_LOGFILE=$(shell command nethack --showpaths | grep scoredir | sed 's/.*"\(.*\)".*/\1/g')/logfile
|
|
NETHACK_LOGFILE_DATA_FILE=data/nethack/logfile/$(HOSTNAME).json
|
|
|
|
.PHONY: site deploy clean
|
|
|
|
site:
|
|
@echo "Building site"
|
|
hugo --buildFuture --enableGitInfo --destination "$(BUILD_DIR)"
|
|
|
|
deploy: site
|
|
@echo "Removing .DS_Store files from $(DEPLOY_LOCATION)"
|
|
find "$(BUILD_DIR)" -name .DS_Store -print -delete
|
|
@echo "Deploying to $(DEPLOY_LOCATION)"
|
|
rsync -avz --no-times --no-perms --delete "$(BUILD_DIR)/" "$(DEPLOY_LOCATION)"
|
|
git tag -f $(shell ./scripts/website deployment next-tag)
|
|
|
|
deployall: nethack deploy
|
|
|
|
nethack: nethack-logfile nethack-commit
|
|
|
|
nethack-logfile: $(NETHACK_LOGFILE)
|
|
ifeq (,$(wildcard $<))
|
|
@echo "Importing Nethack logfile from $(NETHACK_LOGFILE)"
|
|
scripts/import-nethack-logfile.py -o $(NETHACK_LOGFILE_DATA_FILE) $<
|
|
endif
|
|
|
|
nethack-commit: $(NETHACK_LOGFILE_DATA_FILE)
|
|
if ! git diff --quiet $<; then git commit -m "Update Nethack logfile for $(HOSTNAME)" -- $<; fi
|
|
|
|
clean:
|
|
rm -rf "$(BUILD_DIR)/"
|