#!/bin/bash # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". local_checkout=/home/git/local/checkouts/fsf-giving-guide case $1 in refs/heads/master) ;; *) echo echo "use the 'master' branch to update the gift giving site." echo exit 0 ;; esac unset GIT_DIR echo Deploying to fsf.org... cd $local_checkout echo Updating local checkout... git pull git reset --hard $1 echo Copying files... # copy the v8 etc dirs. # note, the -f arg is a trick documented in the rsync man page rsync -vazm --delete --include='/v[[:digit:]]/***' --include='/v[[:digit:]][[:digit:]]/***' \ -f 'hide,! */' /home/git/local/checkouts/fsf-giving-guide/ vcshookuser@fsf.org:/var/www/fsf-giving-guide echo Fixing permissions on webserver... ssh vcshookuser@fsf.org chmod -R ug=rwX,o=rX /var/www/fsf-giving-guide exec git update-server-info