diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-02 09:17:43 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-02 09:17:43 +0000 |
commit | 76f7f349669524809db2daa34d07d4af9b9e9544 (patch) | |
tree | e5e020d921f454b1f61b903e76e31d37a5ffaeb4 /lib/gitlab_projects.rb | |
parent | 99fa0c6e878ed7e5e6292a87524bd43edfafbc9f (diff) | |
parent | a71c80721de28e59147dc6b8c8326c98570a1cb8 (diff) | |
download | gitlab-shell-76f7f349669524809db2daa34d07d4af9b9e9544.tar.gz |
Merge branch 'hooks-refactoring' into 'master'
Hooks refactoring
* replace update hook with pre-receive & post-receive hooks
* use pre-receive hook for authorisation
* use post-receive hook to create background job for GitLab worker
Related to https://dev.gitlab.org/gitlab/gitlabhq/issues/1516
See merge request !38
Diffstat (limited to 'lib/gitlab_projects.rb')
-rw-r--r-- | lib/gitlab_projects.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index a6fa1b5..a27036b 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -18,9 +18,11 @@ class GitlabProjects attr_reader :full_path def self.create_hooks(path) - hook = File.join(path, 'hooks', 'update') - File.delete(hook) if File.exists?(hook) - File.symlink(File.join(ROOT_PATH, 'hooks', 'update'), hook) + %w(pre-receive post-receive).each do |hook_name| + hook = File.join(path, 'hooks', hook_name) + File.delete(hook) if File.exists?(hook) + File.symlink(File.join(ROOT_PATH, 'hooks', hook_name), hook) + end end def initialize |