summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/project_creator.rb
blob: 77bb3ca65819da60393486b2be793e367374fc13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Gitlab
  module ImportExport
    class ProjectCreator
      def initialize(namespace_id, current_user, file, project_path)
        @namespace_id = namespace_id
        @current_user = current_user
        @file = file
        @project_path = project_path
      end

      def execute
        ::Projects::CreateService.new(
          @current_user,
          name: @project_path,
          path: @project_path,
          namespace_id: @namespace_id,
          import_type: "gitlab_project",
          import_source: @file
        ).execute
      end
    end
  end
end