gitlab-org--gitlab-foss/lib/tasks/gitlab/import.rake
Bob Van Landuyt d8d2b73b9f Improve bare repository import
- Allow imports into nested groups
- Make sure it sets the correct visibility level when creating new
  groups

While doing this, I moved the import into a testable class, that made
it easier to improve.
2017-08-23 13:36:37 +02:00

24 lines
790 B
Ruby

namespace :gitlab do
namespace :import do
# How to use:
#
# 1. copy the bare repos under the repository storage paths (commonly the default path is /home/git/repositories)
# 2. run: bundle exec rake gitlab:import:repos RAILS_ENV=production
#
# Notes:
# * The project owner will set to the first administator of the system
# * Existing projects will be skipped
#
#
desc "GitLab | Import bare repositories from repositories -> storages into GitLab project instance"
task repos: :environment do
if Project.current_application_settings.hashed_storage_enabled
puts 'Cannot import repositories when Hashed Storage is enabled'.color(:red)
exit 1
end
Gitlab::BareRepositoryImporter.execute
end
end
end