Class: Projects::ImportExport::RelationExportService
- Inherits:
-
Object
- Object
- Projects::ImportExport::RelationExportService
- Includes:
- Gitlab::ImportExport::CommandLineUtil
- Defined in:
- app/services/projects/import_export/relation_export_service.rb
Constant Summary
Constants included from Gitlab::ImportExport::CommandLineUtil
Gitlab::ImportExport::CommandLineUtil::CLEAN_DIR_IGNORE_FILE_NAMES, Gitlab::ImportExport::CommandLineUtil::CommandLineUtilError, Gitlab::ImportExport::CommandLineUtil::DEFAULT_DIR_MODE, Gitlab::ImportExport::CommandLineUtil::FileOversizedError, Gitlab::ImportExport::CommandLineUtil::HardLinkError, Gitlab::ImportExport::CommandLineUtil::UNTAR_MASK
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(relation_export, user, jid, params = {}) ⇒ RelationExportService
constructor
A new instance of RelationExportService.
Methods included from Gitlab::ImportExport::CommandLineUtil
#gunzip, #gzip, #gzip_with_options, #mkdir_p, #tar_cf, #tar_czf, #untar_xf, #untar_zxf
Constructor Details
#initialize(relation_export, user, jid, params = {}) ⇒ RelationExportService
Returns a new instance of RelationExportService.
8 9 10 11 12 13 14 |
# File 'app/services/projects/import_export/relation_export_service.rb', line 8 def initialize(relation_export, user, jid, params = {}) @relation_export = relation_export @user = user @jid = jid @logger = Gitlab::Export::Logger.build @params = params end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/services/projects/import_export/relation_export_service.rb', line 16 def execute relation_export.update!(status_event: :start, jid: jid) mkdir_p(shared.export_path) mkdir_p(shared.archive_path) if relation_saver.save compress_export_path upload_compressed_file relation_export.finish! else raise_error(shared.errors.join(', ')) end ensure FileUtils.remove_entry(shared.export_path) if File.exist?(shared.export_path) FileUtils.remove_entry(shared.archive_path) if File.exist?(shared.archive_path) end |