From 99e271a327f1cd93b230198376ede5b4ebea82cf Mon Sep 17 00:00:00 2001 From: yann64 Date: Sun, 11 Oct 2026 15:50:54 +0200 Subject: [PATCH] Add deploy target for the test server Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ --- Makefile | 14 +++++++++++++- README.md | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1aa6c8c9..3cfda140 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ OC ?= ../oc +# test server: the www share of barbel-lescar, mounted from the file manager (smb://barbel-lescar/www) +DEPLOY_DIR ?= /run/user/$(shell id -u)/gvfs/smb-share:server=barbel-lescar,share=www/oldcomputers +DEPLOY_URL ?= https://barbel.synology.me/oldcomputers/ -.PHONY: content build check serve +.PHONY: content build check serve deploy content: ## regenerate content/ and static/media/ from the extraction repo python3 $(OC)/scripts/05_hugo.py --target $(CURDIR) @@ -14,3 +17,12 @@ check: build ## build, then verify every internal link and image serve: ## local preview on http://localhost:1313 hugo server + +deploy: ## build for DEPLOY_URL, check, and copy public/ to DEPLOY_DIR + rm -rf public + hugo --panicOnWarning --minify --baseURL $(DEPLOY_URL) + python3 tools/check_links.py public + @test -d "$(dir $(DEPLOY_DIR))" || { echo "share not mounted: $(dir $(DEPLOY_DIR))"; exit 1; } + mkdir -p "$(DEPLOY_DIR)" + rsync -r --size-only --info=stats1 public/media/ "$(DEPLOY_DIR)/media/" + rsync -rc --delete --exclude=/media/ --info=stats1 public/ "$(DEPLOY_DIR)/" diff --git a/README.md b/README.md index cb4a49bf..91f2ef18 100644 --- a/README.md +++ b/README.md @@ -18,5 +18,6 @@ Static rebuild of old-computers.com with [Hugo](https://gohugo.io/) (0.158 or ne make build # build into public/ make check # build + verify every internal link and image make serve # preview on http://localhost:1313 + make deploy # build and copy to the test server (share must be mounted; see DEPLOY_DIR/DEPLOY_URL) The site uses relative URLs, so `public/` can be served from any directory of a web server.