summaryrefslogtreecommitdiff
path: root/hooks/post-receive
blob: da0ff416c6d377c8732573820278e63a30deb415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.

refs = ARGF.read
key_id  = ENV['GL_ID']
repo_path = Dir.pwd

# reset GL_ID env since we already got its value
ENV['GL_ID'] = nil

require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_post_receive'

if GitlabPostReceive.new(repo_path, key_id, refs).exec &&
    GitlabCustomHook.new.post_receive(refs, repo_path)
  exit 0
else
  exit 1
end