Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created July 25, 2011 12:51
Show Gist options
  • Save vangberg/1104053 to your computer and use it in GitHub Desktop.
Save vangberg/1104053 to your computer and use it in GitHub Desktop.
pseudo ci, lol.
#!/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