diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-01 18:57:43 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-01 18:57:43 +0300 |
commit | c6909d0c941784d60cb552d5685e1ff808323991 (patch) | |
tree | 6345045fc3eb928caa0fbf9d9604ff94c2e9cf12 | |
parent | 99fa0c6e878ed7e5e6292a87524bd43edfafbc9f (diff) | |
download | gitlab-shell-c6909d0c941784d60cb552d5685e1ff808323991.tar.gz |
Add new pre-receive and post-receive hooks
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rwxr-xr-x | hooks/post-receive | 17 | ||||
-rwxr-xr-x | hooks/pre-receive | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/hooks/post-receive b/hooks/post-receive new file mode 100755 index 0000000..d85ad42 --- /dev/null +++ b/hooks/post-receive @@ -0,0 +1,17 @@ +#!/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 diff --git a/hooks/pre-receive b/hooks/pre-receive new file mode 100755 index 0000000..2b979fa --- /dev/null +++ b/hooks/pre-receive @@ -0,0 +1,17 @@ +#!/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! + +refs = ARGF.read +key_id = ENV['GL_ID'] +repo_path = Dir.pwd + +require_relative '../lib/gitlab_access' + +if GitlabAccess.new(repo_path, key_id, refs).exec + exit 0 +else + exit 1 +end |