#!/usr/bin/env bash ## USER CONFIG WEBSITE=$1 ## /USER CONFIG cd ~/repos/$WEBSITE git fetch origin > /dev/null git reset --hard origin/master > /dev/null echo "Building $WEBSITE..." echo "-----" ~/bin/hugo echo "-----" # Update the the files rsync -crlpgoDi --delete public/* /web/$WEBSITE/public | while read unused filename; do echo "Updated $filename" done # Fix the group chgrp -hRf web-admins /web/$WEBSITE/public # Make all files group writable find /web/$WEBSITE/public -type f -exec chmod 664 {} \; echo "$WEBSITE has been built and deployed!"