Welcome to mirror list, hosted at ThFree Co, Russian Federation.

status.rake « gitlab « tasks « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a16b1512dde0a9ac4c7226c305e3f08b62e8a54a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
namespace :gitlab do
  namespace :app do
    desc "GITLAB | Check gitlab installation status"
    task :status => :environment  do
      puts "Starting diagnostic".yellow
      git_base_path = Gitlab.config.git_base_path

      print "config/database.yml............"
      if File.exists?(File.join Rails.root, "config", "database.yml") 
        puts "exists".green
      else 
        puts "missing".red
        return
      end

      print "config/gitlab.yml............"
      if File.exists?(File.join Rails.root, "config", "gitlab.yml")
        puts "exists".green 
      else
        puts "missing".red
        return
      end

      print "#{git_base_path}............"
      if File.exists?(git_base_path)  
        puts "exists".green 
      else 
        puts "missing".red
        return
      end

      print "#{git_base_path} is writable?............"
      if File.stat(git_base_path).writable?
        puts "YES".green 
      else
        puts "NO".red
        return
      end

      begin
        `git clone #{Gitlab.config.gitolite_admin_uri} /tmp/gitolite_gitlab_test`
        FileUtils.rm_rf("/tmp/gitolite_gitlab_test")
        print "Can clone gitolite-admin?............"
        puts "YES".green 
      rescue 
        print "Can clone gitolite-admin?............"
        puts "NO".red
        return
      end

      print "UMASK for .gitolite.rc is 0007? ............"
      unless open("#{git_base_path}/../.gitolite.rc").grep(/UMASK([ \t]*)=([ \t>]*)0007/).empty?
        puts "YES".green 
      else
        puts "NO".red
        return
      end

      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

          puts "post-reveice file ok".green
        end
      end

      puts "\nFinished".blue
    end
  end
end