aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 0ec97b3..28762ef 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,3 +1,4 @@
+SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.ONESHELL:
.DELETE_ON_ERROR:
@@ -6,13 +7,13 @@ MAKEFLAGS += --no-builtin-rules
CACHEDIR=/tmp/hugo-cache-$(USER)
DESTDIR=public/
-HOSTNAME=$(shell hostname)
+HOSTNAME=$(shell hostname -f)
REVISION=$(shell git rev-parse HEAD)
.PHONY: build
build: ## make build # builds an optimized version of the website in $(DESTDIR)
@echo "----- Generating site -----"
- hugo --gc --minify --cleanDestinationDir -d $(DESTDIR) --cacheDir $(CACHEDIR)
+ hugo --gc --minify --cleanDestinationDir -d $(DESTDIR) --cacheDir $(CACHEDIR) --buildFuture
cp public/index.json search/
cp public/search/index.html search/
(cd search && CGO_ENABLED=0 go build -ldflags '-s -w -extldflags "-static"' ./search.go)
@@ -28,7 +29,13 @@ clean: ## make clean # removed all $(DESTDIR) contents
rm -rf $(DESTDIR)
.PHONY: deploy
-deploy: ## make deploy # deploy the website the active kubernetes context
+deploy: ## make deploy # deploy the website to myth.adyxax.org
+ rsync -a $(DESTDIR) root@myth.adyxax.org:/srv/www/
+ rsync search/search root@myth.adyxax.org:/srv/www/search/search
+ ssh root@myth.adyxax.org "systemctl restart www-search"
+
+.PHONY: deploy-kube
+deploy-kube: ## make deploy-kube # deploy the website to the active kubernetes context
sed -i deploy/www.yaml -e 's/^\(\s*image:[^:]*:\).*$$/\1$(REVISION)/'
kubectl apply -f deploy/www.yaml
@@ -43,6 +50,6 @@ push: ## make push # push the built images to quay.io
.PHONY: serve
serve: ## make serve # hugo web server development mode
- hugo serve --disableFastRender --noHTTPCache --cacheDir $(CACHEDIR) --bind 0.0.0.0 --port 1313 -b http://$(HOSTNAME):1313/
+ hugo serve --disableFastRender --noHTTPCache --cacheDir $(CACHEDIR) --bind 0.0.0.0 --port 1313 -b http://$(HOSTNAME):1313/ --buildFuture --navigateToChanged
.DEFAULT_GOAL := help