Initial commit
[deploy-hooks.git] / civicrm-core.git / post-update
CommitLineData
31d5f75f
LMM
1#!/bin/bash
2
3unset GIT_DIR
4SELF=deploy_hooks.git
5REPO_DIR=$HOME/repositories
6CHECKOUT_DIR=$HOME/local/checkouts/deploy-hooks
7
8case $1 in
9 refs/heads/stable)
10 echo "Updating hooks on vcs.fsf.org..."
11 ;;
12 *)
13 echo 'No rules for this branch!'
14 exit 0
15 ;;
16esac
17
18echo "Updating local checkout..."
19if [ ! -d $CHECKOUT_DIR ]; then
20 git clone $REPO_DIR/$self $CHECKOUT_DIR
21 git checkout stable
22else
23 cd $CHECKOUT_DIR
24 git pull origin stable
25fi
26
27echo "Syncing hooks..."
28for working_copy in $(find $CHECKOUT_DIR -type d -maxdepth 1 -name '*git'); do
29 rsync -avrSPX --delete $working_copy/hooks/* $REPO_DIR/{$working_copy//*\//}/hooks/
30done
31
32exec git update-server-info
33
34