Commit 9988282e845f76733b43de15d303ef05d38c44ad
1 parent
51f7d949
Exists in
master
and in
4 other branches
Diasgnostic task for gitlab
Showing
1 changed file
with
58 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,58 @@ |
1 | +desc "Check gitlab installation status" | |
2 | +task :gitlab_status => :environment do | |
3 | + puts "Starting diagnostic" | |
4 | + | |
5 | + print "config/database.yml............" | |
6 | + if File.exists?(File.join Rails.root, "config", "database.yml") | |
7 | + puts "exists".green | |
8 | + else | |
9 | + puts "missing".red | |
10 | + return | |
11 | + end | |
12 | + | |
13 | + print "config/gitlab.yml............" | |
14 | + if File.exists?(File.join Rails.root, "config", "gitlab.yml") | |
15 | + puts "exists".green | |
16 | + else | |
17 | + puts "missing".red | |
18 | + return | |
19 | + end | |
20 | + | |
21 | + GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"] | |
22 | + print "/home/git/repositories/............" | |
23 | + if File.exists?(GIT_HOST['base_path']) | |
24 | + puts "exists".green | |
25 | + else | |
26 | + puts "missing".red | |
27 | + return | |
28 | + end | |
29 | + | |
30 | + print "/home/git/repositories/ is writable?............" | |
31 | + if File.stat(GIT_HOST['base_path']).writable? | |
32 | + puts "YES".green | |
33 | + else | |
34 | + puts "NO".red | |
35 | + return | |
36 | + end | |
37 | + | |
38 | + begin | |
39 | + `git clone #{GIT_HOST["admin_uri"]} /tmp/gitolite_gitlab_test` | |
40 | + FileUtils.rm_rf("/tmp/gitolite_gitlab_test") | |
41 | + print "Can clone gitolite-admin?............" | |
42 | + puts "YES".green | |
43 | + rescue | |
44 | + print "Can clone gitolite-admin?............" | |
45 | + puts "NO".red | |
46 | + return | |
47 | + end | |
48 | + | |
49 | + print "UMASK for .gitolite.rc is 0007? ............" | |
50 | + unless open("#{GIT_HOST['base_path']}/../.gitolite.rc").grep(/REPO_UMASK = 0007/).empty? | |
51 | + puts "YES".green | |
52 | + else | |
53 | + puts "NO".red | |
54 | + return | |
55 | + end | |
56 | + | |
57 | + puts "\nFinished" | |
58 | +end | ... | ... |