From eb6d1494bae930a364bfcc76454fc31f78ba7258 Mon Sep 17 00:00:00 2001 From: Seirdy Date: Thu, 20 Jun 2024 16:08:33 -0400 Subject: [PATCH] Clean up some deployment bits - setup-ci.sh: stop writing an ssh config since I pass around options on the CLI. - Makefile: tidy some things, remove unused stuff, add some docs. - Makefile: clean up unnecessary dupe files from rsync output a bit --- Makefile | 13 +++++++------ scripts/setup-ci.sh | 8 +++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c327cea..a23948e 100644 --- a/Makefile +++ b/Makefile @@ -12,16 +12,14 @@ WWW_RSYNC_DEST = $(USER):$(WWW_ROOT) GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT) OUTPUT_DIR = public -SSHFLAGS = -o KexAlgorithms=sntrup761x25519-sha512@openssh.com -RSYNCFLAGS += -rlpcv --zc=zstd --zl=6 --skip-compress=gz/br/zst/png/webp/jpg/avif/jxl/mp4/mkv/webm/opus/mp3/gif/ico -e "ssh $(SSHFLAGS)" --chmod=D755,F644 +SSHFLAGS = -o KexAlgorithms=sntrup761x25519-sha512@openssh.com -o VerifyHostKeyDNS=yes +SKIP_COMPRESS=gz/br/zst/png/webp/jpg/avif/jxl/mp4/mkv/webm/opus/mp3/gif/ico +RSYNCFLAGS += -rlpcv --zc=zstd --zl=6 --skip-compress=$(SKIP_COMPRESS) -e "ssh $(SSHFLAGS)" --chmod=D755,F644 RSYNCFLAGS_EXTRA ?= # compression gets slow for extreme levels like the old "70109". # Diminishing returns after level 6; sometimes even larger files. ECT_LEVEL=6 -# For quick builds, just build these sections: -RENDER_SECTIONS=entries - csv/webrings.csv: sh scripts/populate-webrings.sh @@ -138,9 +136,12 @@ xhtmlize: hugo copy-to-xhtml: find $(OUTPUT_DIR) -type f -name "*.html" | grep -v 'resume/index.html' | xargs -n1 sh scripts/copy-file-to-xhtml.sh +# The grep command at the end makes the output much less noisy. +# filter out duplicate xhtml files (they're just copies of the .html files) +# filter gzip files (their zopfli-like compression is not deterministic) .PHONY: deploy-html deploy-html: - rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) --exclude 'gemini' --exclude '*.gmi' --exclude-from .rsyncignore $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST) --delete | grep -v 'l\.gz$$' + rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) --exclude 'gemini' --exclude '*.gmi' --exclude-from .rsyncignore $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST) --delete | grep -Ev '\.(gz|xhtml)$$' .PHONY: deploy-gemini deploy-gemini: diff --git a/scripts/setup-ci.sh b/scripts/setup-ci.sh index d8aac21..72f1243 100644 --- a/scripts/setup-ci.sh +++ b/scripts/setup-ci.sh @@ -5,12 +5,10 @@ # no pipefail here since there are no pipes. set -eux -# configure ssh -echo "VerifyHostKeyDNS=yes -KexAlgorithms=sntrup761x25519-sha512@openssh.com" >> ~/.ssh/config - # mirrored at https://seirdy.one/pb/binaries.tar.gz -rsync -WPv deploy@seirdy.one:/var/www/pb/binaries.tar.gz . +rsync -WPv \ + -e "ssh -o KexAlgorithms=sntrup761x25519-sha512@openssh.com -o VerifyHostKeyDNS=yes" \ + deploy@seirdy.one:/var/www/pb/binaries.tar.gz . mkdir -p ~/bin tar xzf binaries.tar.gz -oC ~/bin rm binaries.tar.gz