2017-02-05 18:04:23 +00:00
|
|
|
module Gitlab
|
|
|
|
module GitalyClient
|
|
|
|
class Notifications
|
|
|
|
attr_accessor :stub
|
|
|
|
|
2017-02-16 02:08:30 +00:00
|
|
|
def initialize(repository_storage, relative_path)
|
2017-04-06 14:54:15 +00:00
|
|
|
@channel = Util.channel(repository_storage)
|
|
|
|
@repository = Util.repository(repository_storage, relative_path)
|
2017-02-16 02:08:30 +00:00
|
|
|
@stub = Gitaly::Notifications::Stub.new(nil, nil, channel_override: @channel)
|
2017-02-05 18:04:23 +00:00
|
|
|
end
|
|
|
|
|
2017-03-22 17:23:40 +00:00
|
|
|
def post_receive
|
2017-02-16 02:08:30 +00:00
|
|
|
request = Gitaly::PostReceiveRequest.new(repository: @repository)
|
2017-03-22 17:23:40 +00:00
|
|
|
@stub.post_receive(request)
|
2017-02-05 18:04:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|