2012-10-30 07:04:56 -04:00
|
|
|
namespace :gitlab do
|
|
|
|
namespace :import do
|
|
|
|
# How to use:
|
|
|
|
#
|
2016-06-22 17:04:51 -04:00
|
|
|
# 1. copy the bare repos under the repository storage paths (commonly the default path is /home/git/repositories)
|
2014-01-20 04:44:40 -05:00
|
|
|
# 2. run: bundle exec rake gitlab:import:repos RAILS_ENV=production
|
2012-10-30 07:04:56 -04:00
|
|
|
#
|
|
|
|
# Notes:
|
2014-01-20 04:44:40 -05:00
|
|
|
# * The project owner will set to the first administator of the system
|
|
|
|
# * Existing projects will be skipped
|
2012-10-30 07:04:56 -04:00
|
|
|
#
|
2017-08-18 11:21:01 -04:00
|
|
|
#
|
2016-06-22 17:04:51 -04:00
|
|
|
desc "GitLab | Import bare repositories from repositories -> storages into GitLab project instance"
|
2013-05-05 10:01:10 -04:00
|
|
|
task repos: :environment do
|
2017-08-11 06:03:35 -04:00
|
|
|
if Project.current_application_settings.hashed_storage_enabled
|
|
|
|
puts 'Cannot import repositories when Hashed Storage is enabled'.color(:red)
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
|
2017-08-18 11:21:01 -04:00
|
|
|
Gitlab::BareRepositoryImporter.execute
|
2012-10-30 07:04:56 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|