deploy-git.sh (724 bytes)
1 #!/bin/sh 2 # deploy-git.sh - regenerate the stagit-style pages and publish them. 3 # Run from the repo root, in Git Bash / any POSIX shell (needs git, gh, python3, ssh, tar). 4 # sh deploy-git.sh 5 set -e 6 HOST=root@honjimaku.com 7 WEBROOT=/var/www/recentlywritten 8 9 python3 stagit-gen.py equwal git "${TMPDIR:-${TEMP:-/tmp}}/stagit-cache" 10 11 # Replace only git/ and git.html; nothing else in the webroot is touched. 12 ssh "$HOST" "rm -rf $WEBROOT/git" 13 tar cf - git git.html | ssh "$HOST" "cd $WEBROOT && tar xf - --no-same-owner \ 14 && chown -R 197108:197121 git git.html \ 15 && find git -type d -exec chmod 775 {} + && find git -type f -exec chmod 664 {} + \ 16 && chmod 664 git.html" 17 echo "published: https://recentlywritten.com/git/"