blob: a4b2e32794ba3462a4e541329e8021641bfa5580 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/env ruby
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
refs = $stdin.read
key_id = ENV['GL_ID']
protocol = ENV['GL_PROTOCOL']
repo_path = Dir.pwd
require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_access'
if GitlabAccess.new(repo_path, key_id, refs, protocol).exec &&
GitlabCustomHook.new.pre_receive(refs, repo_path)
exit 0
else
# reset GL_ID env since we stop git push here
ENV['GL_ID'] = nil
exit 1
end
|