summaryrefslogtreecommitdiff
path: root/post-receive
blob: f223baf09ce21dad779e109bb87fc610cd7a24e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -e
GITDIR="$(pwd)"
BUILDDIR="/tmp/build_www_$(date +%s)"
BRANCH=$(cat | sed -e "s/[a-z0-9]* [a-z0-9]* refs\/heads\/\(.*\)/\1/g")
if test "$BRANCH" != "master"; then
	exit 0
fi
echo "Deploying ..."
git clone --recurse-submodules -q $GITDIR $BUILDDIR
cd $BUILDDIR
mkdir dist/

set +e
./build
set -e

cd $GITDIR
rsync -r --delete $BUILDDIR/dist/ /srv/http/index/
rm -rf $BUILDDIR