debian-mirror-gitlab/lib/tasks/gitlab/import_export.rake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1.2 KiB
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2016-08-24 12:49:21 +05:30
namespace :gitlab do
namespace :import_export do
2020-03-13 15:44:24 +05:30
desc 'GitLab | Import/Export | Show Import/Export version'
2016-08-24 12:49:21 +05:30
task version: :environment do
puts "Import/Export v#{Gitlab::ImportExport.version}"
end
2020-03-13 15:44:24 +05:30
desc 'GitLab | Import/Export | Display exported DB structure'
2016-08-24 12:49:21 +05:30
task data: :environment do
2019-09-04 21:01:54 +05:30
puts Gitlab::ImportExport::Config.new.to_h['project_tree'].to_yaml(SortKeys: true)
2016-08-24 12:49:21 +05:30
end
2018-03-17 18:26:18 +05:30
2020-03-13 15:44:24 +05:30
desc 'GitLab | Import/Export | Bumps the Import/Export version in fixtures and project templates'
2018-11-08 19:23:39 +05:30
task bump_version: :environment do
archives = Dir['vendor/project_templates/*.tar.gz']
archives.push('spec/features/projects/import_export/test_project_export.tar.gz')
archives.each do |archive|
raise ArgumentError unless File.exist?(archive)
Dir.mktmpdir do |tmp_dir|
system("tar -zxf #{archive} -C #{tmp_dir} > /dev/null")
File.write(File.join(tmp_dir, 'VERSION'), Gitlab::ImportExport.version, mode: 'w')
system("tar -zcvf #{archive} -C #{tmp_dir} . > /dev/null")
end
2018-03-17 18:26:18 +05:30
end
2018-11-08 19:23:39 +05:30
puts "Updated #{archives} to #{Gitlab::ImportExport.version}."
2018-03-17 18:26:18 +05:30
end
2016-08-24 12:49:21 +05:30
end
end