summaryrefslogtreecommitdiff
path: root/lib/gitlab_post_receive.rb
diff options
context:
space:
mode:
authorDrew Blessing <drew.blessing@me.com>2014-10-29 22:21:10 -0500
committerDrew Blessing <drew.blessing@me.com>2014-11-05 15:16:43 -0600
commit3ef7cdf9f94035da5640a585b8c49b0693af2090 (patch)
tree5ad3dbaa118504d185071a5f4e36f8a8cbc3e3dd /lib/gitlab_post_receive.rb
parent00b3d2cb7095af3859734c88a7797182e598f047 (diff)
downloadgitlab-shell-3ef7cdf9f94035da5640a585b8c49b0693af2090.tar.gz
Support for custom hooks
Diffstat (limited to 'lib/gitlab_post_receive.rb')
-rw-r--r--lib/gitlab_post_receive.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb
index bd80408..b4770d9 100644
--- a/lib/gitlab_post_receive.rb
+++ b/lib/gitlab_post_receive.rb
@@ -23,9 +23,12 @@ class GitlabPostReceive
def update_redis
queue = "#{config.redis_namespace}:queue:post_receive"
msg = JSON.dump({'class' => 'PostReceive', 'args' => [@repo_path, @actor, @changes]})
- unless system(*config.redis_command, 'rpush', queue, msg, err: '/dev/null', out: '/dev/null')
+ if system(*config.redis_command, 'rpush', queue, msg,
+ err: '/dev/null', out: '/dev/null')
+ return true
+ else
puts "GitLab: An unexpected error occurred (redis-cli returned #{$?.exitstatus})."
- exit 1
+ return false
end
end
end