Parameterize the Makefile; add automatic importing of Nethack logfiles
This commit is contained in:
parent
566c915f43
commit
d2ab14f649
1 changed files with 23 additions and 4 deletions
27
Makefile
27
Makefile
|
@ -1,11 +1,30 @@
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
DEPLOY_LOCATION=eryn@nutmeg.erynwells.me:/srv/www/erynwells.me/html
|
DEPLOY_USER=eryn
|
||||||
|
DEPLOY_HOSTNAME=nutmeg.erynwells.me
|
||||||
|
DEPLOY_PATH=/srv/www/erynwells.me/html
|
||||||
|
DEPLOY_LOCATION=$(DEPLOY_USER)@$(DEPLOY_HOSTNAME):$(DEPLOY_LOCATION)
|
||||||
|
|
||||||
.PHONY: site
|
HOSTNAME=$(shell hostname -s)
|
||||||
site:
|
|
||||||
|
NETHACK_LOGFILE=$(shell nethack --showpaths | grep scoredir | sed 's/.*"\(.*\)".*/\1/g')/logfile
|
||||||
|
NETHACK_LOGFILE_DATA_FILE=data/nethack/logfile/$(HOSTNAME).json
|
||||||
|
|
||||||
|
.PHONY: deploy clean
|
||||||
|
|
||||||
|
site: public/index.html nethack
|
||||||
|
@echo "Building site"
|
||||||
hugo
|
hugo
|
||||||
|
|
||||||
.PHONY: deploy
|
|
||||||
deploy: site
|
deploy: site
|
||||||
|
@echo "Deploying to $(DEPLOY_LOCATION)"
|
||||||
rsync -avz --no-times --no-perms --delete public/ $(DEPLOY_LOCATION)
|
rsync -avz --no-times --no-perms --delete public/ $(DEPLOY_LOCATION)
|
||||||
|
|
||||||
|
nethack: $(NETHACK_LOGFILE)
|
||||||
|
ifeq (,$(wildcard $<))
|
||||||
|
@echo "Importing Nethack logfile from $(NETHACK_LOGFILE)"
|
||||||
|
scripts/import-nethack-logfile.py -o $(NETHACK_LOGFILE_DATA_FILE) $<
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf public/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue