summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/github_listener/handle_request
blob: a520904865912546f5c3e794f7411e77fea57415 (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
27
28
29
#!/bin/sh
# Possible Shell Vars
#   WEBDIR 
#   HOSTFOLDER

set -euf
#export GRAPHITE_HOST=${GRAPHITE_HOST:-no_omo}
PATH=$PATH:../../../util/bin
if [ "x${2:-}" = x ];then
	echo "usage: $0 HOSTDIRECTORY WEBDIRECTORY"
	exit 1
fi
NOW=$(timer)
export HOSTDIR=${1:-../../hosts}
WEBDIR=${2:-/var/www/euer.krebsco.de/retiolum/}
echo "sorry for keeping you waiting, please be patient"
logger "github_listener: received hook"
cd $(dirname $(readlink -f $0))

cd "$HOSTDIR"
git pull origin master | logger 
echo "First step done"
cd - >&2
../../bin/create-supernode-tar $WEBDIR
echo "almost done..."
../../bin/create-host-tar $WEBDIR
echo "Thank you for your patience! I stole $(timer $NOW)ms of your time, sorry about that."
#graphitec 'retiolum.pack.build_time' $(timer $NOW)
logger "github_listener: finished"