Commit d1daeba1736ba145fe525ce08a91f29495a3abf1

Authored by randx
1 parent d862ebd3

Updated app:status & docs with hooks. Removed write_hooks from app:setup

doc/installation.md
... ... @@ -119,7 +119,6 @@ Permissions:
119 119  
120 120 sudo chmod -R g+rwX /home/git/repositories/
121 121 sudo chown -R git:git /home/git/repositories/
122   - sudo chown gitlab:gitlab /home/git/repositories/**/hooks/post-receive
123 122  
124 123 #### CHECK: Logout & login again to apply git group to your user
125 124  
... ... @@ -177,6 +176,11 @@ Permissions:
177 176 #### Setup DB
178 177  
179 178 sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production
  179 +
  180 +#### Setup gitlab hooks
  181 +
  182 + sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive
  183 + sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive
180 184  
181 185 Checking status:
182 186  
... ... @@ -196,6 +200,7 @@ Checking status:
196 200 Resolving deltas: 100% (174/174), done.
197 201 Can clone gitolite-admin?............YES
198 202 UMASK for .gitolite.rc is 0007? ............YES
  203 + /home/git/share/gitolite/hooks/common/post-receive exists? ............YES
199 204  
200 205 If you got all YES - congrats! You can go to next step.
201 206  
... ...
lib/tasks/gitlab/setup.rake
... ... @@ -4,7 +4,6 @@ namespace :gitlab do
4 4 task :setup => [
5 5 'db:setup',
6 6 'db:seed_fu',
7   - 'gitlab:gitolite:write_hooks',
8 7 'gitlab:app:enable_automerge'
9 8 ]
10 9 end
... ...
lib/tasks/gitlab/status.rake
... ... @@ -56,6 +56,20 @@ namespace :gitlab do
56 56 return
57 57 end
58 58  
  59 + gitolite_hooks_path = File.join("/home", Gitlab.config.ssh_user, "share", "gitolite", "hooks", "common")
  60 + gitlab_hook_files = ['post-receive']
  61 + gitlab_hook_files.each do |file_name|
  62 + dest = File.join(gitolite_hooks_path, file_name)
  63 + print "#{dest} exists? ............"
  64 + if File.exists?(dest)
  65 + puts "YES".green
  66 + else
  67 + puts "NO".red
  68 + return
  69 + end
  70 + end
  71 +
  72 +
59 73 if Project.count > 0
60 74 puts "Validating projects repositories:".yellow
61 75 Project.find_each(:batch_size => 100) do |project|
... ...