summaryrefslogtreecommitdiff
path: root/lib/gitlab_projects.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-04 10:08:13 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-04 10:08:13 +0200
commitc2bf1061c2b5c739f4ced047e7cda4ce2a4929df (patch)
tree4b4f4418a88ce4da42e8350a5f8c73bb07f8e20b /lib/gitlab_projects.rb
parent4908b89495e27b6ea829f32143c7753a6139df32 (diff)
downloadgitlab-shell-c2bf1061c2b5c739f4ced047e7cda4ce2a4929df.tar.gz
link post-receive hook also
Diffstat (limited to 'lib/gitlab_projects.rb')
-rw-r--r--lib/gitlab_projects.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
index 89fb603..ae8cb2d 100644
--- a/lib/gitlab_projects.rb
+++ b/lib/gitlab_projects.rb
@@ -10,6 +10,7 @@ class GitlabProjects
@project_name = ARGV.shift
@repos_path = GitlabConfig.new.repos_path
@full_path = File.join(@repos_path, @project_name)
+ @hook_path = File.join(ROOT_PATH, 'hooks', 'post-receive')
end
def exec
@@ -24,8 +25,8 @@ class GitlabProjects
protected
def add_project
- FileUtils.mkdir_p(@full_path, mode: 0770 )
- cmd = "cd #{@full_path} && git init --bare"
+ FileUtils.mkdir_p(@full_path, mode: 0770)
+ cmd = "cd #{@full_path} && git init --bare && ln -s #{@hook_path} #{@full_path}/hooks/post-receive"
system(cmd)
end