Add sanitize option to gitlab check rake task.
This commit is contained in:
parent
d5a8f9ccca
commit
4c68d2387e
1 changed files with 26 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue