gitlab-org--gitlab-foss/lib/tasks/gitlab/git.rake
Zeger-Jan van de Weg f1f7bfc06f
Remove git rake tasks
These tasks are happening through housekeeping right now, by default
ever 10th push. This removes the need for these tasks.

Side note, this removes one of my first contributions to GitLab, as back
than I introduced these tasks through: 54e6c0045b

Closes https://gitlab.com/gitlab-org/gitaly/issues/768
2018-07-31 14:31:50 +02:00

25 lines
672 B
Ruby

namespace :gitlab do
namespace :git do
desc 'GitLab | Git | Check all repos integrity'
task fsck: :gitlab_environment do
failures = []
Project.find_each(batch_size: 100) do |project|
begin
project.repository.fsck
rescue => e
failures << "#{project.full_path} on #{project.repository_storage}: #{e}"
end
puts "Performed integrity check for #{project.repository.full_path}"
end
if failures.empty?
puts "Done".color(:green)
else
puts "The following repositories reported errors:".color(:red)
failures.each { |f| puts "- #{f}" }
end
end
end
end