generate sitemap as part of deployment

This allows adding the lastmod field based on the last modification date
of the file.
This commit is contained in:
Daniel Micay
2024-05-15 01:52:10 -04:00
parent 5ed267e8df
commit 94068c3cff
3 changed files with 73 additions and 109 deletions

View File

@@ -19,10 +19,16 @@ rsync -pcv --chmod=F644 --fsync --preallocate replicate.conf root@${servers[0]}:
# use last modified timestamps from 0.grapheneos.org
rsync -rptcv --chmod=D755,F644 --delete --fsync --preallocate root@${servers[0]}:/srv/grapheneos.org/ static-production
rsync -pcv --chmod=D755,F644 --fsync --preallocate static-production/sitemap.xml{,.gz,.br} static-tmp/
rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-tmp/ static-production
for f in static-production/**.*(br|gz); do
touch -r "${f%.*}" "$f"
done
./generate-sitemap
xmllint --noblanks static-tmp/sitemap.xml --output static-tmp/sitemap.xml
brotli -f static-tmp/sitemap.xml
zopfli static-tmp/sitemap.xml
rsync -pcv --chmod=D755,F644 --fsync --preallocate static-tmp/sitemap.xml{,.gz,.br} static-production/
for server in ${servers[@]}; do
echo $server