summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-08-31 18:12:08 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-09-05 14:29:06 -0300
commitc658360e94ea31a411923dbd14591c41fbecffdd (patch)
tree972700e41e7a9fc55bce9a1680567161dec3d9b5 /lib/gitlab_net.rb
parent9a0f4703acb3b7304216ff5d00d1779232a8b70f (diff)
downloadgitlab-shell-gitaly-redis-refactor.tar.gz
Support new /internal/pre-receive API endpoint for post-receivegitaly-redis-refactor
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index b48f655..de0cc57 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -126,6 +126,14 @@ class GitlabNet
JSON.parse(resp.body) if resp.code == '200'
end
+ def pre_receive(gl_repository)
+ resp = post("#{host}/pre_receive", gl_repository: gl_repository)
+
+ raise NotFound if resp.code == '404'
+
+ JSON.parse(resp.body) if resp.code == '200'
+ end
+
def redis_client
redis_config = config.redis
database = redis_config['database'] || 0