blob: 8a53b51d4fe07909b956f2801fc00f29e20c969d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
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
|