2016-06-13 18:35:57 +00:00
|
|
|
module Gitlab
|
|
|
|
module ImportExport
|
|
|
|
class ProjectCreator
|
2016-06-14 14:31:03 +00:00
|
|
|
def initialize(namespace_id, current_user, file, project_path)
|
|
|
|
@namespace_id = namespace_id
|
2016-06-13 18:35:57 +00:00
|
|
|
@current_user = current_user
|
2016-06-14 14:31:03 +00:00
|
|
|
@file = file
|
|
|
|
@project_path = project_path
|
2016-06-13 18:35:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
|
|
|
::Projects::CreateService.new(
|
2016-06-14 18:32:19 +00:00
|
|
|
@current_user,
|
2016-06-14 14:31:03 +00:00
|
|
|
name: @project_path,
|
|
|
|
path: @project_path,
|
2016-06-14 18:32:19 +00:00
|
|
|
namespace_id: @namespace_id,
|
2016-06-14 14:31:03 +00:00
|
|
|
import_type: "gitlab_project",
|
|
|
|
import_source: @file
|
2016-06-13 18:35:57 +00:00
|
|
|
).execute
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|