From 1d3815f89b9b9f5ecfd6dd15158a2988603b9ed8 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Wed, 26 Jul 2017 14:21:53 +0200 Subject: Allow projects to be started from a template Started implementation for the first iteration of gitlab-org/gitlab-ce#32420. This will allow users to select a template to start with, instead of an empty repository in the project just created. Internally this is basically a small extension of the ImportExport GitLab projects we already support. We just import a certain import tar archive. This commits includes the first one: Ruby on Rails. In the future more will be added. --- app/controllers/import/gitlab_projects_controller.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'app/controllers/import') diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 36d246d185b..6463d2dfd5b 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -12,15 +12,7 @@ class Import::GitlabProjectsController < Import::BaseController return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." }) end - import_upload_path = Gitlab::ImportExport.import_upload_path(filename: project_params[:file].original_filename) - - FileUtils.mkdir_p(File.dirname(import_upload_path)) - FileUtils.copy_entry(project_params[:file].path, import_upload_path) - - @project = Gitlab::ImportExport::ProjectCreator.new(project_params[:namespace_id], - current_user, - import_upload_path, - project_params[:path]).execute + @project = ::Projects::GitlabProjectsImporterService.new(current_user, project_params).execute if @project.saved? redirect_to( -- cgit v1.2.3