#
# An example hook script that is called after a successful
# push is made.
-#
-exec ./post-update.ryf.fsf.org
+echo "------- post-update started -------"
+# Disabling this, we're moving to rsync because it works better.
+#ssh www-data@ryf.fsf.org "cd /var/www/git;git pull"
+unset GIT_DIR
+SELF=ryf.git
+REPO_DIR=$HOME/repositories
+CHECKOUT_DIR=$HOME/local/checkouts/$SELF
+TARGET_DIR=/var/www
+TARGET_HOST=ryf.fsf.org
+
+
+case $1 in
+ refs/heads/live)
+ branch=live
+ TARGET_DIR=$TARGET_DIR/ryf.fsf.org
+ ;;
+ refs/heads/dev)
+ branch=dev
+ TARGET_DIR=$TARGET_DIR/ryf-dev.fsf.org
+ ;;
+*)
+ echo "No action for this branch!"
+ ;;
+esac
+
+
+echo "Updating local checkout..."
+if [ ! -d $CHECKOUT_DIR ]; then
+ git clone $REPO_DIR/$SELF $CHECKOUT_DIR
+ cd $CHECKOUT_DIR
+ git checkout $branch
+else
+ cd $CHECKOUT_DIR
+ git checkout $branch
+ git pull origin $branch
+fi
+
+if [ -n $TARGET_HOST ]; then
+ echo Deploying to: $TARGET_DIR
+ rsync -avrSPX --delete-after $CHECKOUT_DIR/* root@$TARGET_HOST:$TARGET_DIR/
+fi
+echo "------- post-update finished ------"
+exec git update-server-info
+
+
+
+++ /dev/null
-#!/bin/sh
-#
-# An example hook script that is called after a successful
-# push is made.
-#
-
-echo "------- post-update started -------"
-# Disabling this, we're moving to rsync because it works better.
-#ssh www-data@ryf.fsf.org "cd /var/www/git;git pull"
-unset GIT_DIR
-SELF=ryf.git
-REPO_DIR=$HOME/repositories
-CHECKOUT_DIR=$HOME/local/checkouts/$SELF
-TARGET_DIR=/var/www
-TARGET_HOST=ryf.fsf.org
-
-
-case $1 in
- refs/heads/live)
- branch=live
- TARGET_DIR=$TARGET_DIR/ryf.fsf.org
- ;;
- refs/heads/dev)
- branch=dev
- TARGET_DIR=$TARGET_DIR/ryf-dev.fsf.org
- ;;
-*)
- echo "No action for this branch!"
- ;;
-esac
-
-
-echo "Updating local checkout..."
-if [ ! -d $CHECKOUT_DIR ]; then
- git clone $REPO_DIR/$SELF $CHECKOUT_DIR
- cd $CHECKOUT_DIR
- git checkout $branch
-else
- cd $CHECKOUT_DIR
- git checkout $branch
- git pull origin $branch
-fi
-
-if [ -n $TARGET_HOST ]; then
- echo Deploying to: $TARGET_DIR
- rsync -avrSPX --delete-after $CHECKOUT_DIR/* root@$TARGET_HOST:$TARGET_DIR/
-fi
-
-exec git update-server-info
-echo "------- post-update finished ------"
-