Module: Gitlab::ImportExport

Extended by:
ImportExport
Included in:
ImportExport
Defined in:
lib/gitlab/import_export.rb,
lib/gitlab/import_export/error.rb,
lib/gitlab/import_export/saver.rb,
lib/gitlab/import_export/config.rb,
lib/gitlab/import_export/reader.rb,
lib/gitlab/import_export/shared.rb,
lib/gitlab/import_export/importer.rb,
lib/gitlab/import_export/log_util.rb,
lib/gitlab/import_export/hash_util.rb,
lib/gitlab/import_export/lfs_saver.rb,
lib/gitlab/import_export/repo_saver.rb,
lib/gitlab/import_export/avatar_saver.rb,
lib/gitlab/import_export/lfs_restorer.rb,
lib/gitlab/import_export/file_importer.rb,
lib/gitlab/import_export/repo_restorer.rb,
lib/gitlab/import_export/uploads_saver.rb,
lib/gitlab/import_export/version_saver.rb,
lib/gitlab/import_export/members_mapper.rb,
lib/gitlab/import_export/avatar_restorer.rb,
lib/gitlab/import_export/uploads_manager.rb,
lib/gitlab/import_export/version_checker.rb,
lib/gitlab/import_export/wiki_repo_saver.rb,
lib/gitlab/import_export/group/tree_saver.rb,
lib/gitlab/import_export/uploads_restorer.rb,
lib/gitlab/import_export/attribute_cleaner.rb,
lib/gitlab/import_export/attributes_finder.rb,
lib/gitlab/import_export/command_line_util.rb,
lib/gitlab/import_export/design_repo_saver.rb,
lib/gitlab/import_export/project/base_task.rb,
lib/gitlab/import_export/duration_measuring.rb,
lib/gitlab/import_export/json/ndjson_reader.rb,
lib/gitlab/import_export/json/ndjson_writer.rb,
lib/gitlab/import_export/project/tree_saver.rb,
lib/gitlab/import_export/snippet_repo_saver.rb,
lib/gitlab/import_export/base/object_builder.rb,
lib/gitlab/import_export/group/tree_restorer.rb,
lib/gitlab/import_export/project/export_task.rb,
lib/gitlab/import_export/project/import_task.rb,
lib/gitlab/import_export/snippets_repo_saver.rb,
lib/gitlab/import_export/statistics_restorer.rb,
lib/gitlab/import_export/attributes_permitter.rb,
lib/gitlab/import_export/design_repo_restorer.rb,
lib/gitlab/import_export/fast_hash_serializer.rb,
lib/gitlab/import_export/group/group_restorer.rb,
lib/gitlab/import_export/group/object_builder.rb,
lib/gitlab/import_export/merge_request_parser.rb,
lib/gitlab/import_export/remote_stream_upload.rb,
lib/gitlab/import_export/base/relation_factory.rb,
lib/gitlab/import_export/project/tree_restorer.rb,
lib/gitlab/import_export/snippet_repo_restorer.rb,
lib/gitlab/import_export/group/relation_factory.rb,
lib/gitlab/import_export/import_failure_service.rb,
lib/gitlab/import_export/project/object_builder.rb,
lib/gitlab/import_export/project/relation_saver.rb,
lib/gitlab/import_export/snippets_repo_restorer.rb,
lib/gitlab/import_export/recursive_merge_folders.rb,
lib/gitlab/import_export/project/relation_factory.rb,
lib/gitlab/import_export/json/streaming_serializer.rb,
lib/gitlab/import_export/base/relation_object_saver.rb,
lib/gitlab/import_export/group/relation_tree_restorer.rb,
lib/gitlab/import_export/project/sample/tree_restorer.rb,
lib/gitlab/import_export/after_export_strategy_builder.rb,
lib/gitlab/import_export/project/relation_tree_restorer.rb,
lib/gitlab/import_export/project/sample/date_calculator.rb,
lib/gitlab/import_export/project/sample/relation_factory.rb,
lib/gitlab/import_export/project/exported_relations_merger.rb,
lib/gitlab/import_export/decompressed_archive_size_validator.rb,
lib/gitlab/import_export/project/sample/relation_tree_restorer.rb,
lib/gitlab/import_export/after_export_strategies/move_file_strategy.rb,
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb,
lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb,
lib/gitlab/import_export/after_export_strategies/download_notification_strategy.rb

Defined Under Namespace

Modules: AfterExportStrategies, Base, CommandLineUtil, DurationMeasuring, Group, Json, Project Classes: AfterExportStrategyBuilder, AttributeCleaner, AttributesFinder, AttributesPermitter, AvatarRestorer, AvatarSaver, Config, DecompressedArchiveSizeValidator, DesignRepoRestorer, DesignRepoSaver, Error, FastHashSerializer, FileImporter, HashUtil, ImportFailureService, Importer, LfsRestorer, LfsSaver, LogUtil, MembersMapper, MergeRequestParser, Reader, RecursiveMergeFolders, RemoteStreamUpload, RepoRestorer, RepoSaver, Saver, Shared, SnippetRepoRestorer, SnippetRepoSaver, SnippetsRepoRestorer, SnippetsRepoSaver, StatisticsRestorer, UploadsManager, UploadsRestorer, UploadsSaver, VersionChecker, VersionSaver, WikiRepoSaver

Constant Summary collapse

VERSION =

For every version update the version history in these docs must be kept up to date:

  • development/import_export.md

  • user/project/settings/import_export.md

'0.2.4'
FILENAME_LIMIT =
50

Instance Method Summary collapse

Instance Method Details

#config_fileObject



61
62
63
# File 'lib/gitlab/import_export.rb', line 61

def config_file
  Rails.root.join('lib/gitlab/import_export/project/import_export.yml')
end

#design_repo_bundle_filenameObject



45
46
47
# File 'lib/gitlab/import_export.rb', line 45

def design_repo_bundle_filename
  'project.design.bundle'
end

#export_filename(exportable:) ⇒ Object



77
78
79
80
81
# File 'lib/gitlab/import_export.rb', line 77

def export_filename(exportable:)
  basename = "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_#{exportable.full_path.tr('/', '_')}"

  "#{basename[0..FILENAME_LIMIT]}_export.tar.gz"
end

#export_path(relative_path:) ⇒ Object



13
14
15
# File 'lib/gitlab/import_export.rb', line 13

def export_path(relative_path:)
  File.join(storage_path, relative_path)
end

#gitlab_revision_filenameObject



73
74
75
# File 'lib/gitlab/import_export.rb', line 73

def gitlab_revision_filename
  'GITLAB_REVISION'
end

#gitlab_version_filenameObject



69
70
71
# File 'lib/gitlab/import_export.rb', line 69

def gitlab_version_filename
  'GITLAB_VERSION'
end

#group_config_fileObject



99
100
101
# File 'lib/gitlab/import_export.rb', line 99

def group_config_file
  Rails.root.join('lib/gitlab/import_export/group/import_export.yml')
end

#group_filenameObject



91
92
93
# File 'lib/gitlab/import_export.rb', line 91

def group_filename
  'group.json'
end

#group_wiki_repo_bundle_filename(group_id) ⇒ Object



103
104
105
# File 'lib/gitlab/import_export.rb', line 103

def group_wiki_repo_bundle_filename(group_id)
  "#{group_id}.wiki.bundle"
end

#group_wiki_repo_bundle_full_path(shared, group_id) ⇒ Object



111
112
113
# File 'lib/gitlab/import_export.rb', line 111

def group_wiki_repo_bundle_full_path(shared, group_id)
  group_wiki_repo_bundle_path(shared, group_wiki_repo_bundle_filename(group_id))
end

#group_wiki_repo_bundle_path(shared, filename) ⇒ Object



107
108
109
# File 'lib/gitlab/import_export.rb', line 107

def group_wiki_repo_bundle_path(shared, filename)
  File.join(shared.export_path, 'repositories', filename)
end

#import_upload_path(filename:) ⇒ Object



21
22
23
# File 'lib/gitlab/import_export.rb', line 21

def import_upload_path(filename:)
  File.join(storage_path, 'uploads', filename)
end

#legacy_group_config_fileObject



95
96
97
# File 'lib/gitlab/import_export.rb', line 95

def legacy_group_config_file
  Rails.root.join('lib/gitlab/import_export/group/legacy_import_export.yml')
end

#lfs_objects_filenameObject



33
34
35
# File 'lib/gitlab/import_export.rb', line 33

def lfs_objects_filename
  "lfs-objects.json"
end

#lfs_objects_storageObject



37
38
39
# File 'lib/gitlab/import_export.rb', line 37

def lfs_objects_storage
  "lfs-objects"
end

#project_bundle_filenameObject



29
30
31
# File 'lib/gitlab/import_export.rb', line 29

def project_bundle_filename
  "project.bundle"
end

#project_filenameObject



25
26
27
# File 'lib/gitlab/import_export.rb', line 25

def project_filename
  "project.json"
end

#reset_tokens?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/gitlab/import_export.rb', line 87

def reset_tokens?
  true
end

#snippet_repo_bundle_dirObject



49
50
51
# File 'lib/gitlab/import_export.rb', line 49

def snippet_repo_bundle_dir
  'snippets'
end

#snippet_repo_bundle_filename_for(snippet) ⇒ Object



57
58
59
# File 'lib/gitlab/import_export.rb', line 57

def snippet_repo_bundle_filename_for(snippet)
  "#{snippet.hexdigest}.bundle"
end

#snippets_repo_bundle_path(absolute_path) ⇒ Object



53
54
55
# File 'lib/gitlab/import_export.rb', line 53

def snippets_repo_bundle_path(absolute_path)
  File.join(absolute_path, ::Gitlab::ImportExport.snippet_repo_bundle_dir)
end

#storage_pathObject



17
18
19
# File 'lib/gitlab/import_export.rb', line 17

def storage_path
  File.join(Settings.shared['path'], 'tmp/gitlab_exports')
end

#versionObject



83
84
85
# File 'lib/gitlab/import_export.rb', line 83

def version
  VERSION
end

#version_filenameObject



65
66
67
# File 'lib/gitlab/import_export.rb', line 65

def version_filename
  'VERSION'
end

#wiki_repo_bundle_filenameObject



41
42
43
# File 'lib/gitlab/import_export.rb', line 41

def wiki_repo_bundle_filename
  "project.wiki.bundle"
end