self-updating post-receive. this is an awful idea

main
Jonathan Dahan 12 months ago
parent 4af558d4ce
commit 947b7f234e

@ -3,8 +3,7 @@ set -e -u -o pipefail
while read oldrev newrev ref while read oldrev newrev ref
do do
if [[ $ref =~ .*/main$ ]]; if [[ $ref =~ .*/main$ ]]; then
then
echo "main ref received" echo "main ref received"
echo "moving into temporary work tree"; { echo "moving into temporary work tree"; {
@ -23,5 +22,9 @@ do
echo "restarting server"; { echo "restarting server"; {
podman-compose restart || podman compose up podman-compose restart || podman compose up
} }
echo "updating post-receive hook for future runs"; {
cp hooks/post-receive $0
}
fi fi
done done

Loading…
Cancel
Save