First attempt at a post-receive hook that posts directly to Resque

This commit is contained in:
Ariejan de Vroom 2011-12-13 01:03:26 +01:00
parent 1c9b9b7a3b
commit bc0155fbaa
5 changed files with 30 additions and 14 deletions

12
lib/post-receive-hook Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
# This file was placed here by Gitlab. It makes sure that your pushed commits
# will be processed properly.
while read oldrev newrev ref
do
# For every branch or tag that was pushed, create a Resque job in redis.
pwd=`pwd`
reponame=`basename "$pwd" | cut -d. -f1`
env -i redis-cli rpush "resque:queue:post-receive" "{\"class\":\"PostReceive\",\"args\":[\"$reponame\",\"$oldrev\",\"$newrev\",\"$ref\"]}" > /dev/null 2>&1
done