1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 12:52:10 +00:00

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
This commit is contained in:
Seirdy 2024-06-20 16:08:33 -04:00
parent 6392968041
commit eb6d1494ba
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 10 additions and 11 deletions

View file

@ -12,16 +12,14 @@ WWW_RSYNC_DEST = $(USER):$(WWW_ROOT)
GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT) GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT)
OUTPUT_DIR = public OUTPUT_DIR = public
SSHFLAGS = -o KexAlgorithms=sntrup761x25519-sha512@openssh.com SSHFLAGS = -o KexAlgorithms=sntrup761x25519-sha512@openssh.com -o VerifyHostKeyDNS=yes
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 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 ?= RSYNCFLAGS_EXTRA ?=
# compression gets slow for extreme levels like the old "70109". # compression gets slow for extreme levels like the old "70109".
# Diminishing returns after level 6; sometimes even larger files. # Diminishing returns after level 6; sometimes even larger files.
ECT_LEVEL=6 ECT_LEVEL=6
# For quick builds, just build these sections:
RENDER_SECTIONS=entries
csv/webrings.csv: csv/webrings.csv:
sh scripts/populate-webrings.sh sh scripts/populate-webrings.sh
@ -138,9 +136,12 @@ xhtmlize: hugo
copy-to-xhtml: copy-to-xhtml:
find $(OUTPUT_DIR) -type f -name "*.html" | grep -v 'resume/index.html' | xargs -n1 sh scripts/copy-file-to-xhtml.sh 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 .PHONY: deploy-html
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 .PHONY: deploy-gemini
deploy-gemini: deploy-gemini:

View file

@ -5,12 +5,10 @@
# no pipefail here since there are no pipes. # no pipefail here since there are no pipes.
set -eux set -eux
# configure ssh
echo "VerifyHostKeyDNS=yes
KexAlgorithms=sntrup761x25519-sha512@openssh.com" >> ~/.ssh/config
# mirrored at https://seirdy.one/pb/binaries.tar.gz # 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 mkdir -p ~/bin
tar xzf binaries.tar.gz -oC ~/bin tar xzf binaries.tar.gz -oC ~/bin
rm binaries.tar.gz rm binaries.tar.gz