2022-04-13 07:47:02 -07:00
|
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
2024-11-01 21:17:34 -07:00
|
|
|
BUILD_DIR=public
|
|
|
|
|
2024-05-26 09:26:40 -07:00
|
|
|
CONTENT_PATH=content
|
|
|
|
|
2022-11-20 10:00:20 -08:00
|
|
|
DEPLOY_USER=eryn
|
|
|
|
DEPLOY_HOSTNAME=nutmeg.erynwells.me
|
|
|
|
DEPLOY_PATH=/srv/www/erynwells.me/html
|
2022-11-20 22:45:50 -08:00
|
|
|
DEPLOY_LOCATION=$(DEPLOY_USER)@$(DEPLOY_HOSTNAME):$(DEPLOY_PATH)
|
2022-04-13 07:47:02 -07:00
|
|
|
|
2022-11-20 10:00:20 -08:00
|
|
|
HOSTNAME=$(shell hostname -s)
|
|
|
|
|
2023-04-02 09:29:49 -07:00
|
|
|
NETHACK_LOGFILE=$(shell command nethack --showpaths | grep scoredir | sed 's/.*"\(.*\)".*/\1/g')/logfile
|
2022-11-20 10:00:20 -08:00
|
|
|
NETHACK_LOGFILE_DATA_FILE=data/nethack/logfile/$(HOSTNAME).json
|
|
|
|
|
2023-02-04 18:26:41 -08:00
|
|
|
.PHONY: site deploy clean
|
2022-11-20 10:00:20 -08:00
|
|
|
|
2024-11-01 21:17:34 -07:00
|
|
|
site:
|
2022-11-20 10:00:20 -08:00
|
|
|
@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
|
|
|
|
2022-11-12 07:50:06 -08:00
|
|
|
deploy: site
|
2022-11-20 10:00:20 -08:00
|
|
|
@echo "Deploying to $(DEPLOY_LOCATION)"
|
2024-11-01 21:17:34 -07:00
|
|
|
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)
|
2022-11-20 10:00:20 -08:00
|
|
|
|
2024-11-01 21:17:34 -07:00
|
|
|
deployall: nethack deploy
|
|
|
|
|
2023-01-10 16:16:53 -08:00
|
|
|
nethack: nethack-logfile nethack-commit
|
|
|
|
|
|
|
|
nethack-logfile: $(NETHACK_LOGFILE)
|
2022-11-20 10:00:20 -08:00
|
|
|
ifeq (,$(wildcard $<))
|
|
|
|
@echo "Importing Nethack logfile from $(NETHACK_LOGFILE)"
|
|
|
|
scripts/import-nethack-logfile.py -o $(NETHACK_LOGFILE_DATA_FILE) $<
|
|
|
|
endif
|
|
|
|
|
2023-01-10 16:16:53 -08:00
|
|
|
nethack-commit: $(NETHACK_LOGFILE_DATA_FILE)
|
|
|
|
if ! git diff --quiet $<; then git commit -m "Update Nethack logfile for $(HOSTNAME)" -- $<; fi
|
|
|
|
|
2022-11-20 10:00:20 -08:00
|
|
|
clean:
|
2024-11-01 21:17:34 -07:00
|
|
|
rm -rf "$(BUILD_DIR)/"
|