#!/bin/sh # automatically configured by git-annex if git annex post-receive --help >/dev/null 2>&1; then git annex post-receive; fi echo "git post-receive hook: starting" GIT_DIR=.git WORKING_REPO=../content CWD=$(pwd) PYTHON='' WWW_SCRIPT='' CPU_CORE= while read oldrev newrev ref do # synchronize git checkout folder BRANCH=`echo $ref | cut -d/ -f3` # avoid error with git-annex `synced` branches if ! [ $BRANCH = 'synced' ]; then cd $WORKING_REPO \ && git pull origin $BRANCH \ && git annex sync --content fi done # rebuild all changed images echo "rebuild updated images..." CPU_CORE=$CPU_CORE $PYTHON $WWW_SCRIPT build-all-images $WORKING_REPO echo "git post-receive hook: ending"