summaryrefslogtreecommitdiff
path: root/lib/post-receive-hook
diff options
context:
space:
mode:
authorAriejan de Vroom <ariejan@ariejan.net>2011-12-13 01:03:26 +0100
committerAriejan de Vroom <ariejan@ariejan.net>2011-12-13 01:03:26 +0100
commitbc0155fbaa1261f348324c1ddf5d1eaba5907f77 (patch)
tree3c8f651b1572b9a515a994b8d015ee770885fdc1 /lib/post-receive-hook
parent1c9b9b7a3b0ae2ee60e4cda5d1ac2541c17302f8 (diff)
downloadgitlab-ce-bc0155fbaa1261f348324c1ddf5d1eaba5907f77.tar.gz
First attempt at a post-receive hook that posts directly to Resque
Diffstat (limited to 'lib/post-receive-hook')
-rwxr-xr-xlib/post-receive-hook12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/post-receive-hook b/lib/post-receive-hook
new file mode 100755
index 00000000000..ec7c607f75d
--- /dev/null
+++ b/lib/post-receive-hook
@@ -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