summaryrefslogtreecommitdiffhomepage
path: root/cronjob.sh
blob: f36be1ce74de7ed2246ef350cd967268d9e1ec64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# This script gets run by a cronjob every minute.  It pulls from the git server
# and checks for changes.  If any changes were made, we rebuild the site.

PATH=$PATH:/usr/local/bin

h1=`git rev-parse HEAD`
git pull
h2=`git rev-parse HEAD`

[ $h1 = $h2 ] || {
	make
	./build
	git diff --name-only HEAD^ HEAD | grep -q server.go                     \
		&& systemctl restart euro-thomasvoss-com.service
}