added doc building to tc plugin
authorLisa Marie Maginnis <lisam@fsf.org>
Wed, 22 Jul 2015 19:36:35 +0000 (15:36 -0400)
committerLisa Marie Maginnis <lisam@fsf.org>
Wed, 22 Jul 2015 19:36:35 +0000 (15:36 -0400)
trustcommerce.git/post-update

index 047c75431ee9afd20e23dd5f57a8bfd2b5548e5d..5250bf85cf4540b0f90ab0fd68edc7284c086f08 100755 (executable)
@@ -16,6 +16,8 @@ repository=/home/git/repositories/trustcommerce.git
 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..."
@@ -34,8 +36,10 @@ echo -n $(date "$date_fmt"); echo " - Processing branch: $1"
 # 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)
@@ -44,11 +48,13 @@ case $branch in
        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"
@@ -60,12 +66,23 @@ if [ ! -d $local_checkout ]; then
     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