how to add my own code in hooks/post-receive
Created by: swpustc
I have update GitLab to v7.3.0, this version has symlink the whole hooks directory. And in post-receive
#!/usr/bin/env ruby
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
# You can add your own hooks to this file, but be careful when updating gitlab-shell!
changes = ARGF.read
key_id = ENV['GL_ID']
repo_path = Dir.pwd
require_relative '../lib/gitlab_post_receive'
if GitlabPostReceive.new(repo_path, key_id, changes).exec
exit 0
else
exit 1
end
I want to add this code:
GIT_WORK_TREE=/home/git/html git checkout -f
What should I do? Thanks.