diff options
author | randx <dmitriy.zaporozhets@gmail.com> | 2012-07-26 17:14:34 +0400 |
---|---|---|
committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-07-26 17:14:34 +0400 |
commit | 18f83016b15a1ad388ccb85a6e0878e7f5f14527 (patch) | |
tree | aea1ca182e262ca60b1e76532ed51e109cf8504a /lib | |
parent | c27105f8c3dc8b0baec0d36f339dbfc943ff155b (diff) |
Fixed persmission issue in doc. Added validation of hooks in gitlab:app:status
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/status.rake | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/status.rake b/lib/tasks/gitlab/status.rake index ac712234b27..96b8886fa89 100644 --- a/lib/tasks/gitlab/status.rake +++ b/lib/tasks/gitlab/status.rake @@ -2,7 +2,7 @@ namespace :gitlab do namespace :app do desc "GITLAB | Check gitlab installation status" task :status => :environment do - puts "Starting diagnostic" + puts "Starting diagnostic".yellow git_base_path = Gitlab.config.git_base_path print "config/database.yml............" @@ -56,7 +56,28 @@ namespace :gitlab do return end - puts "\nFinished" + if Project.count > 0 + puts "Validating projects repositories:".yellow + Project.find_each(:batch_size => 100) do |project| + print "#{project.name}....." + hook_file = File.join(project.path_to_repo, 'hooks','post-receive') + + unless File.exists?(hook_file) + puts "post-receive file missing".red + next + end + + + unless File.owned?(hook_file) + puts "post-receive file is not owner by gitlab".red + next + end + + puts "post-reveice file ok".green + end + end + + puts "\nFinished".blue end end end |