aboutsummaryrefslogtreecommitdiff
path: root/post-receive
blob: f806331891d88deb28e533c73d007e9d65d80fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# Yaroslav de la Peña Smirnov <yps@yaroslavps.com>

#####################################################
#		Copy me to the hooks subdirectory! 			#
# 	git hook to update my site on push to master	#
#####################################################


oldpwd="$PWD"
reponame="yaroslavps.com"
barepath="$HOME/public/$reponame.git"
workingpath="$HOME/hook-clones/$reponame"

while read LINE; do
	if [ "$(echo ${LINE} | awk '{ print $3; }')" = "refs/heads/master" ]
	then
		cd "$HOME/hook-clones"
		git clone $barepath
		cd $reponame
		zola build --output-dir="/home/webuser/www/yaroslavps.com/"
		cd ..
		rm -rf "$reponame"
		exit 0
	fi
done