remote_user=vcshookuser
target_path=~$remote_user/stage/org.fsf.payment.trustcommerce/
+doc_base=/var/www/docs/$package_name
+
deploy_script=/usr/local/bin/deploy-tc.sh
echo -n $(date "$date_fmt"); echo " - Starting post-update hook..."
# Set branch specific configurations
case $branch in
master)
- package_path=$package_path_base/devel
local_checkout=$local_checkout_base/$branch
+ ;;
+ dev)
+ package_path=$package_path_base/devel
target_host=crm-dev.fsf.org
;;
live)
target_host=crm.fsf.org
;;
*)
- echo $branch was deleted
+ echo $branch does not exist
exit
;;
esac
+doc_path=$doc_base/$branch
+
echo -n $(date "$date_fmt"); echo " - Target host: $target_host"
echo -n $(date "$date_fmt"); echo " - Target path: $target_path"
echo -n $(date "$date_fmt"); echo " - Package host: $package_host"
echo -n $(date "$date_fmt"); echo " - No local checkout detected, creating now"
git clone $repository $local_checkout
cd $local_checkout
+ git checkout $branch
else
echo -n $(date "$date_fmt"); echo " - Updating local checkout"
cd $local_checkout
+ git checkout $branch
git pull origin $branch
fi
+# Build the docs for this project
+phpdoc -f trustcommerce.php -t $doc_path --template='responsive'
+
+# Stop here if not updating a host
+if [ -z $target_host ]; then
+ exit
+fi
+
+
echo -n $(date "$date_fmt"); echo " - Pushing files to target host"
rsync -arzSPX --exclude=.git/ --delete $local_checkout/* $remote_user@$target_host:$target_path/ #2>/dev/null