diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-01 19:00:06 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-01 19:00:06 +0300 |
commit | 119aae7d71cac17af9a68122c8b3021adf5cbfd9 (patch) | |
tree | 40c4756ad1b647dd655c13b0805ecf14ae2be372 /lib/gitlab_projects.rb | |
parent | c6909d0c941784d60cb552d5685e1ff808323991 (diff) | |
download | gitlab-shell-119aae7d71cac17af9a68122c8b3021adf5cbfd9.tar.gz |
GitlabAccess and GitlabPostReceive classes added
Gitlab Access handles security check. GitlabPostReceive creates a sidekiq job
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
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 |