πŸ’Ύ Archived View for going-flying.com β€Ί files β€Ί deploy captured on 2023-06-16 at 16:20:12.

View Raw

More Information

⬅️ Previous capture (2023-04-26)

➑️ Next capture (2024-06-16)

-=-=-=-=-=-=-

#!/bin/sh
# going-flying.com post-receive hook for gemini://
# (c) 2016-2020 Matthew J. Ernisse <matt@going-flying.com>
# All Rights Reserved.
#
# Update the on-disk representation of my capsule when I push a new
# revision up to the git repository.

set -e

BRANCH=""
BUILD_DIR="/var/gemini"
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
REV=0

while read oldrev newrev refname; do
	BRANCH="$refname"
	REV="$newrev"
done

if [ "$BRANCH" != "refs/heads/master" ]; then
	echo "detected $BRANCH, aborting"
	exit 0
fi

if [ -z "$GIT_DIR" ]; then
	echo >&2 "fatal: post-receive GIT_DIR not set"
	exit 1
fi

cat << EOF
                                Β»^  \
                               Ζ’     L
                      β–„β–„β–„β–Œ     ⌐    β•’
                     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆb   ΒΌ   /   ,β•“β–„β–„β–“β–ˆβ–Œ
                    β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ     )Θ    β•™β”” β•Ÿβ–ˆβ–ˆβ–ˆβ–Œ
                    β•«β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    ]   β••   Ξ¦β–ˆβ–€β–ˆβ–ˆβ–“β–ˆ
                    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    β•ž    b "β–“ β–β–ˆβ•™Β¬
                    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ         β•˜ ]  β•šβ–€
                    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβŒ    β””
                   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ╓┐  Ξ“
                  β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ,Β¬
                 β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
                ]β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
                β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β•™
              ]β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
              β•Ÿβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
              β•«β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ
              β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
             β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβŒ
             β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ
            ,β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
            β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆΒ΅
               ─└└└└└└└└└└└└└└└└└─
EOF

umask 0022

if [ ! -d "$BUILD_DIR" ]; then
	echo "Creating $BUILD_DIR"

	mkdir -- "$BUILD_DIR"
	chgrp www-data "$BUILD_DIR"
	chmod 664 "$BUILD_DIR"
fi

echo "updating $BUILD_DIR"
GIT_WORK_TREE=$BUILD_DIR git checkout -f

$BUILD_DIR/build/build.py "$BUILD_DIR/users/mernisse/"

echo "setting rev to $REV"
sed -e "s/GIT_REV/${REV}/" "$BUILD_DIR/how-built.gmi" > \
	"$BUILD_DIR/how-built.gmi.new"
mv $BUILD_DIR/how-built.gmi.new $BUILD_DIR/how-built.gmi

echo "site deployed."