mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-27 14:12:09 +00:00
Internal: check-whole-site: deploy in parallel
Saves about a minute of time.
This commit is contained in:
parent
2ed2bf3c88
commit
7cf0e4bc9b
2 changed files with 8 additions and 6 deletions
9
Makefile
9
Makefile
|
@ -14,6 +14,7 @@ GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT)
|
||||||
|
|
||||||
OUTPUT_DIR = public
|
OUTPUT_DIR = public
|
||||||
RSYNCFLAGS += -rlpcv --zc=zstd --zl=6 --skip-compress=gz/br/zst/png/webp/jpg/avif/jxl/mp4/mkv/webm/opus/mp3
|
RSYNCFLAGS += -rlpcv --zc=zstd --zl=6 --skip-compress=gz/br/zst/png/webp/jpg/avif/jxl/mp4/mkv/webm/opus/mp3
|
||||||
|
RSYNCFLAGS_EXTRA ?=
|
||||||
# compression gets slow for extreme levels like the old "70109"
|
# compression gets slow for extreme levels like the old "70109"
|
||||||
ECT_LEVEL=9
|
ECT_LEVEL=9
|
||||||
|
|
||||||
|
@ -66,14 +67,14 @@ htmlproofer:
|
||||||
htmlproofer $(OUTPUT_DIR) --disable-external --report-invalid-tags --report-missing-names --report-missing-doctype --report-eof-tags --report-mismatched-tags --check-html --check-opengraph --check-favicon --empty-alt-ignore --file-ignore $(OUTPUT_DIR)/search/index.html --url-ignore '../music.txt'
|
htmlproofer $(OUTPUT_DIR) --disable-external --report-invalid-tags --report-missing-names --report-missing-doctype --report-eof-tags --report-mismatched-tags --check-html --check-opengraph --check-favicon --empty-alt-ignore --file-ignore $(OUTPUT_DIR)/search/index.html --url-ignore '../music.txt'
|
||||||
|
|
||||||
linter-configs/htmltest.yml:
|
linter-configs/htmltest.yml:
|
||||||
rsync $(RSYNCFLAGS) deploy@seirdy.one:/home/deploy/refcache.json linter-configs/htmltest/refcache.json
|
rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) deploy@seirdy.one:/home/deploy/refcache.json linter-configs/htmltest/refcache.json
|
||||||
|
|
||||||
# basic checks for generated HTML and broken links. Persist the broken
|
# basic checks for generated HTML and broken links. Persist the broken
|
||||||
# link cache remotely so we can run this in CI.
|
# link cache remotely so we can run this in CI.
|
||||||
.PHONY: htmltest
|
.PHONY: htmltest
|
||||||
htmltest: linter-configs/htmltest.yml
|
htmltest: linter-configs/htmltest.yml
|
||||||
htmltest -c linter-configs/htmltest.yml $(OUTPUT_DIR)
|
htmltest -c linter-configs/htmltest.yml $(OUTPUT_DIR)
|
||||||
rsync $(RSYNCFLAGS) linter-configs/htmltest/refcache.json deploy@seirdy.one:/home/deploy/refcache.json
|
rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) linter-configs/htmltest/refcache.json deploy@seirdy.one:/home/deploy/refcache.json
|
||||||
|
|
||||||
.PHONY: hint
|
.PHONY: hint
|
||||||
hint: hugo .hintrc-local
|
hint: hugo .hintrc-local
|
||||||
|
@ -122,11 +123,11 @@ mentions.json: hugo
|
||||||
|
|
||||||
.PHONY: deploy-html
|
.PHONY: deploy-html
|
||||||
deploy-html:
|
deploy-html:
|
||||||
rsync $(RSYNCFLAGS) --exclude 'gemini' --exclude '*.gmi' --exclude-from .rsyncignore $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST) --delete
|
rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) --exclude 'gemini' --exclude '*.gmi' --exclude-from .rsyncignore $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST) --delete
|
||||||
|
|
||||||
.PHONY: deploy-gemini
|
.PHONY: deploy-gemini
|
||||||
deploy-gemini:
|
deploy-gemini:
|
||||||
rsync $(RSYNCFLAGS) --exclude '*.html' --exclude '*.xml' --exclude '*.xhtml' --exclude '*.gz' --exclude '*.br' --exclude-from .rsyncignore $(OUTPUT_DIR)/gemini/ $(OUTPUT_DIR)/about $(OUTPUT_DIR)/posts $(OUTPUT_DIR)/about $(OUTPUT_DIR)/publickey.* $(GEMINI_RSYNC_DEST)/ --delete
|
rsync $(RSYNCFLAGS) $(RSYNCFLAGS_EXTRA) --exclude '*.html' --exclude '*.xml' --exclude '*.xhtml' --exclude '*.gz' --exclude '*.br' --exclude-from .rsyncignore $(OUTPUT_DIR)/gemini/ $(OUTPUT_DIR)/about $(OUTPUT_DIR)/posts $(OUTPUT_DIR)/about $(OUTPUT_DIR)/publickey.* $(GEMINI_RSYNC_DEST)/ --delete
|
||||||
|
|
||||||
.PHONY: deploy
|
.PHONY: deploy
|
||||||
deploy: deploy-html deploy-gemini
|
deploy: deploy-html deploy-gemini
|
||||||
|
|
|
@ -61,8 +61,9 @@ base_url="${1-http://localhost:8089}"
|
||||||
|
|
||||||
# HTML validation is already parallelized, so run that single-threaded.
|
# HTML validation is already parallelized, so run that single-threaded.
|
||||||
make -j1 HUGO_FLAGS=-DF HUGO_BASEURL="$base_url" clean hugo xhtmlize validate-html
|
make -j1 HUGO_FLAGS=-DF HUGO_BASEURL="$base_url" clean hugo xhtmlize validate-html
|
||||||
make -j "$jobs" -f Makefile.online HUGO_BASEURL="$base_url" all-extra URLS="$(curl -sSL "$base_url/sitemap.xml" | htmlq loc -t | rg -v '/search/$' | tr '\n' ' ')"
|
make -j "$jobs" -f Makefile.online HUGO_BASEURL="$base_url" all-extra URLS="$(curl -sSL "$base_url/sitemap.xml" | htmlq loc -t | rg -v '/search/$' | tr '\n' ' ')" &
|
||||||
make deploy-staging -j "$jobs"
|
make deploy-staging RSYNCFLAGS_EXTRA=-q
|
||||||
|
wait
|
||||||
make -f Makefile.online hint-online URLS="$(curl -sSL --compressed https://staging.seirdy.one/sitemap.xml | htmlq loc -t | rg -v '/(?:search|wcag-is-a-starting-point)/$' | sort | tr '\n' ' ')"
|
make -f Makefile.online hint-online URLS="$(curl -sSL --compressed https://staging.seirdy.one/sitemap.xml | htmlq loc -t | rg -v '/(?:search|wcag-is-a-starting-point)/$' | sort | tr '\n' ' ')"
|
||||||
# TODO: run lighthouse on every page in the sitemap.
|
# TODO: run lighthouse on every page in the sitemap.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue