Skip to content
Snippets Groups Projects

Add registry-database import command to gitlab-ctl

Merged João Pereira requested to merge registry-import-command into master
All threads resolved!
Files
3
@@ -9,7 +9,7 @@ module Import
str.gsub(/%%/, ' ' * len)
end
USAGE ||= <<~EOS.freeze
USAGE = <<~EOS.freeze
Import filesystem metadata into the database
Usage:
@@ -28,27 +28,26 @@ module Import
-3, --step-three common-blobs perform step three of a multi-step import: alias for common-blobs
EOS
def self.parse_options!(args, options, option_parser)
def self.parse_options!(args, options)
return unless args.include? CMD_NAME
loop do
break if args.shift == CMD_NAME
end
option_parser.on('-h', '--help', 'Usage help') do
option_parser = OptionParser.new do |opts|
opts.on('-h', '--help', 'Usage help') do
option_parser.set_summary_width(SUMMARY_WIDTH)
Kernel.puts USAGE
Kernel.exit 0
end
end
end.order! args
option_parser.on('-B', '--common-blobs', 'import all blob metadata from common storage') do
options[:common_blobs] = '--common-blobs'
end
option_parser.on('-c' , '--row-count', 'count and log number of rows across relevant database tables on (pre)import completion') do
option_parser.on('-c', '--row-count', 'count and log number of rows across relevant database tables on (pre)import completion') do
options[:row_count] = '--row-count'
end
@@ -68,15 +67,15 @@ module Import
options[:all_repositories] = '--all-repositories'
end
option_parser.on('-1' , '--step-one', 'perform step one of a multi-step import: alias for pre-import') do
option_parser.on('-1', '--step-one', 'perform step one of a multi-step import: alias for pre-import') do
options[:step_one] = '--step-one'
end
option_parser.on('-2' , '--step-two', 'perform step two of a multi-step import: alias for all-repositories') do
option_parser.on('-2', '--step-two', 'perform step two of a multi-step import: alias for all-repositories') do
options[:step_two] = '--step-two'
end
option_parser.on('-3' , '--step-three', 'perform step three of a multi-step import: alias for common-blobs') do
option_parser.on('-3', '--step-three', 'perform step three of a multi-step import: alias for common-blobs') do
options[:step_three] = '--step-three'
end
@@ -86,6 +85,6 @@ module Import
end
def self.needs_stop!(options)
options[:needs_stop] = true unless options.has_key? :dry_run
options[:needs_stop] = true unless options.has_key? :dry_run
end
end
Loading