From: Lisa Marie Maginnis Date: Wed, 22 Jul 2015 19:36:35 +0000 (-0400) Subject: added doc building to tc plugin X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d31f2306295eed6c8ef32f8b5381200e3db5ff8c;p=deploy-hooks.git added doc building to tc plugin --- diff --git a/trustcommerce.git/post-update b/trustcommerce.git/post-update index 047c754..5250bf8 100755 --- a/trustcommerce.git/post-update +++ b/trustcommerce.git/post-update @@ -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