add git hooks into repo

also set "hooksPath = .githooks" and maybe
 "excludesfile = .gitignore" in `.git/config`
main
Dominic Reich 2 years ago
parent 1152044802
commit c8cb765f24
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -0,0 +1,31 @@
#!/bin/bash
# create static files with hugo and upload them with rsync
# to my webserver
# created: 2023-03-26T23:27:11+0200
echo -n "creating website..."
ret="$(hugo --gc --minify)"
# if [ -n "$(echo $ret | grep Total)" ] ; then
if [ "$?" -eq "0" ] ; then
echo " Success!"
else
echo " *** FAILED ***"
echo "Could not create static files (hugo). Aborting..."
# exit with 1, so the update does not proceed, so we will know
exit 1
fi
echo -n "rsyncing files to server..."
ret="$(rsync -avhzP --stats --del public/ bor:/var/www/sites/oe7drt/)"
if [ "$?" -eq "0" ] ; then
echo "Success!"
else
echo " *** FAILED ***"
echo "Could not sync files to webserver (rsync). Aborting..."
exit 1
fi
Loading…
Cancel
Save