erynwells.me/Makefile

43 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

2022-04-13 07:47:02 -07:00
# Eryn Wells <eryn@erynwells.me>
BUILD_DIR=public
2024-05-26 09:26:40 -07:00
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)
2022-04-13 07:47:02 -07:00
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
2023-02-04 18:26:41 -08:00
.PHONY: site deploy clean
site:
@echo "Building site"
2024-11-04 16:38:29 -08:00
hugo --buildFuture --enableGitInfo --destination "$(BUILD_DIR)"
2022-04-13 07:47:02 -07:00
deploy: site
@echo "Deploying to $(DEPLOY_LOCATION)"
rsync -avz --no-times --no-perms --delete "$(BUILD_DIR)/" "$(DEPLOY_LOCATION)"
2023-11-20 11:54:11 -08:00
git tag -f deploy-$(shell date +%Y-%m-%d)
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)/"