summaryrefslogtreecommitdiff
path: root/lib/gitlab_post_receive.rb
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-04-28 17:10:42 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-05-11 12:21:31 -0300
commitee259653e7a00359740ca36cef606f9c3cc1a7cb (patch)
tree6f53403454defd386c4455a6a9ffcf052d4c6695 /lib/gitlab_post_receive.rb
parent1cf14770f3bf5c3255f4c3a8f69ccfab74317fcd (diff)
downloadgitlab-shell-ee259653e7a00359740ca36cef606f9c3cc1a7cb.tar.gz
Handle GL_REPOSITORY env variable and use it in api calls
Diffstat (limited to 'lib/gitlab_post_receive.rb')
-rw-r--r--lib/gitlab_post_receive.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb
index 8383135..403d281 100644
--- a/lib/gitlab_post_receive.rb
+++ b/lib/gitlab_post_receive.rb
@@ -9,10 +9,11 @@ require 'securerandom'
class GitlabPostReceive
include NamesHelper
- attr_reader :config, :repo_path, :changes, :jid
+ attr_reader :config, :gl_repository, :repo_path, :changes, :jid
- def initialize(repo_path, actor, changes)
+ def initialize(gl_repository, repo_path, actor, changes)
@config = GitlabConfig.new
+ @gl_repository = gl_repository
@repo_path, @actor = repo_path.strip, actor
@changes = changes
@jid = SecureRandom.hex(12)
@@ -32,11 +33,11 @@ class GitlabPostReceive
end
merge_request_urls = GitlabMetrics.measure("merge-request-urls") do
- api.merge_request_urls(@repo_path, @changes)
+ api.merge_request_urls(@gl_repository, @repo_path, @changes)
end
print_merge_request_links(merge_request_urls)
- api.notify_post_receive(repo_path)
+ api.notify_post_receive(gl_repository, repo_path)
rescue GitlabNet::ApiUnreachableError
nil
end