summaryrefslogtreecommitdiff
path: root/hooks/pre-receive
blob: 66cb97d0674af7daf048ed0bd19b6e173d08f892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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.delete('GL_ID')
protocol = ENV.delete('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
  exit 1
end