peach-package-builder/ansible/templates/devdocs/git-post-receive

13 lines
597 B
Bash

#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to build directory..."
git --work-tree={{automation_dir}}/devdocs_build --git-dir={{automation_dir}}/devdocs_bare checkout -f
echo "Building docs and deploying to production..."
/root/.cargo/bin/mdbook build {{automation_dir}}/devdocs_build --dest-dir {{web_dir}}/docs:peachcloud:org/html
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
done