Add sanitize option to gitlab check rake task.

This commit is contained in:
Marin Jankovski 2014-07-07 14:12:06 +02:00
parent d5a8f9ccca
commit 4c68d2387e

View file

@ -216,7 +216,12 @@ namespace :gitlab do
puts ""
Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... "
message = if sanitize
"#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... "
else
"#{project.name_with_namespace.yellow} ... "
end
print message
if project.satellite.exists?
puts "yes".green
@ -525,7 +530,12 @@ namespace :gitlab do
puts ""
Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... "
message = if sanitize
"#{project.id.to_s.yellow} ... "
else
"#{project.name_with_namespace.yellow} ... "
end
print message
if project.empty_repo?
puts "repository is empty".magenta
@ -588,7 +598,12 @@ namespace :gitlab do
puts ""
Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... "
message = if sanitize
"#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... "
else
"#{project.name_with_namespace.yellow} ... "
end
print message
if project.namespace
puts "yes".green
@ -837,4 +852,12 @@ namespace :gitlab do
def omnibus_gitlab?
Dir.pwd == '/opt/gitlab/embedded/service/gitlab-rails'
end
def sanitize
if ENV['SANITIZE'] == "true"
true
else
false
end
end
end