提交 c5bc2629 编写于 作者: J James Lopez

few fixes - import from UI working

上级 5908bdf3
......@@ -191,6 +191,7 @@ class ProjectsController < Projects::ApplicationController
end
def export
#TODO: Move to worker
::Projects::ImportExport::ExportService.new(@project, current_user).execute
redirect_to(
......@@ -267,6 +268,7 @@ class ProjectsController < Projects::ApplicationController
def export_project_path
# TODO: move this, probably to ImportExport and refactor
File.join(Settings.shared['path'], 'tmp/project_exports', @project.path_with_namespace, 'project.tar.gz')
folder = File.join(Settings.shared['path'], 'tmp/project_exports', @project.path_with_namespace)
Dir.glob("#{folder}/*export.tar.gz").max_by {|f| File.ctime(f)}
end
end
......@@ -3,7 +3,7 @@ module Projects
class ExportService < BaseService
def execute(options = {})
@shared = Gitlab::ImportExport::Shared.new(relative_path: project.path_with_namespace)
@shared = Gitlab::ImportExport::Shared.new(relative_path: File.join(project.path_with_namespace, 'work'))
save_project_tree
bundle_repo
save_all
......
......@@ -24,7 +24,7 @@ module Gitlab
end
def tar_with_options(archive:, dir:, options:)
cmd = %W(tar -#{options} #{archive} #{dir})
cmd = %W(tar -#{options} #{archive} -C #{dir} .)
_output, status = Gitlab::Popen.popen(cmd)
status.zero?
end
......
......@@ -14,6 +14,7 @@ module Gitlab
def save
if compress_and_save
remove_storage_path
Rails.logger.info("Saved project export #{archive_file}")
archive_file
else
false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册