diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-08-31 18:12:08 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-09-05 14:29:06 -0300 |
commit | c658360e94ea31a411923dbd14591c41fbecffdd (patch) | |
tree | 972700e41e7a9fc55bce9a1680567161dec3d9b5 /lib/gitlab_net.rb | |
parent | 9a0f4703acb3b7304216ff5d00d1779232a8b70f (diff) | |
download | gitlab-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.rb | 8 |
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 |