mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 05:06:46 +10:00
Export project functionality This is a MR for the export functionality of https://gitlab.com/gitlab-org/gitlab-ce/issues/3050, which adds the ability to export single projects. - [x] members - DB data - [x] issues - [x] issue comments - [x] merge requests - [x] merge request diff - [x] merge request comments - [x] labels - [x] milestones - [x] snippets - [x] releases - [x] events - [x] commit statuses - [x] CI builds - File system data - [x] Git repository - [x] wiki - [x] uploads - [ ] ~~CI build traces~~ - [ ] ~~CI build artifacts~~ - [ ] ~~LFS objects~~ - DB configuration - [x] services - [x] web hooks - [x] protected branches - [x] deploy keys - [x] CI variables - [x] CI triggers See merge request !3114
29 lines
852 B
Ruby
29 lines
852 B
Ruby
module Gitlab
|
|
module GitlabImport
|
|
class ProjectCreator
|
|
attr_reader :repo, :namespace, :current_user, :session_data
|
|
|
|
def initialize(repo, namespace, current_user, session_data)
|
|
@repo = repo
|
|
@namespace = namespace
|
|
@current_user = current_user
|
|
@session_data = session_data
|
|
end
|
|
|
|
def execute
|
|
::Projects::CreateService.new(
|
|
current_user,
|
|
name: repo["name"],
|
|
path: repo["path"],
|
|
description: repo["description"],
|
|
namespace_id: namespace.id,
|
|
visibility_level: repo["visibility_level"],
|
|
import_type: "gitlab",
|
|
import_source: repo["path_with_namespace"],
|
|
import_url: repo["http_url_to_repo"].sub("://", "://oauth2:#{@session_data[:gitlab_access_token]}@")
|
|
).execute
|
|
end
|
|
end
|
|
end
|
|
end
|