cleanup rake tasks
This commit is contained in:
parent
30ee53624b
commit
83696b127b
8 changed files with 77 additions and 120 deletions
|
@ -1,37 +1,37 @@
|
|||
namespace :gitlab do
|
||||
namespace :app do
|
||||
desc "GITLAB | Check gitlab installation status"
|
||||
desc "GITLAB | Check GitLab installation status"
|
||||
task :status => :environment do
|
||||
puts "Starting diagnostic".yellow
|
||||
puts "Starting diagnostics".yellow
|
||||
git_base_path = Gitlab.config.git_base_path
|
||||
|
||||
print "config/database.yml............"
|
||||
if File.exists?(File.join Rails.root, "config", "database.yml")
|
||||
if File.exists?(Rails.root.join "config", "database.yml")
|
||||
puts "exists".green
|
||||
else
|
||||
else
|
||||
puts "missing".red
|
||||
return
|
||||
end
|
||||
|
||||
print "config/gitlab.yml............"
|
||||
if File.exists?(File.join Rails.root, "config", "gitlab.yml")
|
||||
puts "exists".green
|
||||
if File.exists?(Rails.root.join "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
|
||||
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
|
||||
puts "YES".green
|
||||
else
|
||||
puts "NO".red
|
||||
return
|
||||
|
@ -41,16 +41,16 @@ namespace :gitlab do
|
|||
`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
|
||||
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
|
||||
if open("#{git_base_path}/../.gitolite.rc").grep(/UMASK([ \t]*)=([ \t>]*)0007/).any?
|
||||
puts "YES".green
|
||||
else
|
||||
puts "NO".red
|
||||
return
|
||||
|
@ -69,16 +69,15 @@ namespace :gitlab do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
if Project.count > 0
|
||||
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')
|
||||
hook_file = File.join(project.path_to_repo, 'hooks', 'post-receive')
|
||||
|
||||
unless File.exists?(hook_file)
|
||||
puts "post-receive file missing".red
|
||||
next
|
||||
puts "post-receive file missing".red
|
||||
return
|
||||
end
|
||||
|
||||
puts "post-receive file ok".green
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue