Created
July 25, 2011 12:51
-
-
Save vangberg/1104053 to your computer and use it in GitHub Desktop.
pseudo ci, lol.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -m | |
[ -f post-receive.pid ] && kill `cat post-receive.pid` &>/dev/null | |
echo $$ > post-receive.pid | |
trap 'kill %%; exit 1' EXIT | |
APIKEY=somekey | |
while true | |
do | |
echo "Waiting for request." | |
echo -ne "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nOK" \ | |
| nc -l 3000 -q -1 \ | |
| grep "$APIKEY" \ | |
&& git fetch \ | |
&& git reset --hard origin/master \ | |
&& rake || echo "Build failed" | mail some@mail.tld | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment