BigW Consortium Gitlab

project_creator.rb 574 Bytes
Newer Older
1 2 3
module Gitlab
  module ImportExport
    class ProjectCreator
4 5
      def initialize(namespace_id, current_user, file, project_path)
        @namespace_id = namespace_id
6
        @current_user = current_user
7 8
        @file = file
        @project_path = project_path
9 10 11 12
      end

      def execute
        ::Projects::CreateService.new(
13
          @current_user,
14 15
          name: @project_path,
          path: @project_path,
16
          namespace_id: @namespace_id,
17 18
          import_type: "gitlab_project",
          import_source: @file
19 20 21 22 23
        ).execute
      end
    end
  end
end