Commit bf775901 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'elastic_rake_with_status' into 'master'

ES: rake gitlab:elastic:index_repositories handles errors and shows progress

Fixes https://gitlab.com/gitlab-org/gitlab-ee/issues/221 and https://gitlab.com/gitlab-org/gitlab-ee/issues/228

See merge request !143
parents 6089966b c9d4f97f
......@@ -7,6 +7,9 @@ v 8.4.2
v 8.4.2 (unreleased)
- Fix updating of branches in mirrored repository
v 8.4.2
- Rake task gitlab:elastic:index_repositories handles errors and shows progress
v 8.4.1
- No EE-specific changes
......
......@@ -2,7 +2,21 @@ namespace :gitlab do
namespace :elastic do
desc "Indexing repositories"
task index_repositories: :environment do
Repository.import
Repository.__elasticsearch__.create_index!
Project.find_each do |project|
if project.repository.exists? && !project.repository.empty?
puts "Indexing #{project.name_with_namespace}..."
begin
project.repository.index_commits
project.repository.index_blobs
puts "Done!".green
rescue StandardError => e
puts "#{e.message}, trace - #{e.backtrace}"
end
end
end
end
desc "Indexing all wikis"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment