summaryrefslogtreecommitdiff
path: root/lib/hooks/post-receive
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hooks/post-receive')
-rwxr-xr-xlib/hooks/post-receive12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/hooks/post-receive b/lib/hooks/post-receive
new file mode 100755
index 00000000000..d38bd13e19d
--- /dev/null
+++ b/lib/hooks/post-receive
@@ -0,0 +1,12 @@
+#!/usr/bin/env 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\",\"$GL_USER\"]}" > /dev/null 2>&1
+done