#!/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... # A lot of files that we *don't* want to copy, so we're selective. rsync -az --delete --prune-empty-dirs \ --include='*/' --include='givingguide.html' --include='js/*' \ --include='images/*' --include='fonts/*' --include='*.css' --exclude='*' \ /home/git/local/checkouts/fsf-giving-guide \ vcshookuser@fsf.org:/var/www/ #2>/dev/null echo Fixing permissions on webserver... ssh vcshookuser@fsf.org 'find /var/www/fsf-giving-guide -type f -print0 | xargs -0 chmod 664 && find /var/www/fsf-giving-guide -type d -print0 | xargs -0 chmod 775' # 2>/dev/null exec git update-server-info