Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
99abbe7d
Commit
99abbe7d
authored
Apr 06, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Projects::CreateService to create imported projects so hooks are executed.
parent
e69e430c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
64 deletions
+12
-64
lib/gitlab/bitbucket_import/project_creator.rb
lib/gitlab/bitbucket_import/project_creator.rb
+3
-16
lib/gitlab/github_import/project_creator.rb
lib/gitlab/github_import/project_creator.rb
+3
-16
lib/gitlab/gitlab_import/project_creator.rb
lib/gitlab/gitlab_import/project_creator.rb
+3
-16
lib/gitlab/gitorious_import/project_creator.rb
lib/gitlab/gitorious_import/project_creator.rb
+3
-16
No files found.
lib/gitlab/bitbucket_import/project_creator.rb
View file @
99abbe7d
...
...
@@ -10,29 +10,16 @@ module Gitlab
end
def
execute
@project
=
Project
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
[
"name"
],
path:
repo
[
"slug"
],
description:
repo
[
"description"
],
namespace:
namespace
,
creator:
current_user
,
namespace_id:
namespace
.
id
,
visibility_level:
repo
[
"is_private"
]
?
Gitlab
::
VisibilityLevel
::
PRIVATE
:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
import_type:
"bitbucket"
,
import_source:
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
,
import_url:
"ssh://git@bitbucket.org/
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
.git"
)
if
@project
.
save!
@project
.
reload
if
@project
.
import_failed?
@project
.
import_retry
else
@project
.
import_start
end
end
@project
).
execute
end
end
end
...
...
lib/gitlab/github_import/project_creator.rb
View file @
99abbe7d
...
...
@@ -10,29 +10,16 @@ module Gitlab
end
def
execute
@project
=
Project
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
.
name
,
path:
repo
.
name
,
description:
repo
.
description
,
namespace:
namespace
,
creator:
current_user
,
namespace_id:
namespace
.
id
,
visibility_level:
repo
.
private
?
Gitlab
::
VisibilityLevel
::
PRIVATE
:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
import_type:
"github"
,
import_source:
repo
.
full_name
,
import_url:
repo
.
clone_url
.
sub
(
"https://"
,
"https://
#{
current_user
.
github_access_token
}
@"
)
)
if
@project
.
save!
@project
.
reload
if
@project
.
import_failed?
@project
.
import_retry
else
@project
.
import_start
end
end
@project
).
execute
end
end
end
...
...
lib/gitlab/gitlab_import/project_creator.rb
View file @
99abbe7d
...
...
@@ -10,29 +10,16 @@ module Gitlab
end
def
execute
@project
=
Project
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
[
"name"
],
path:
repo
[
"path"
],
description:
repo
[
"description"
],
namespace:
namespace
,
creator:
current_user
,
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:
#{
current_user
.
gitlab_access_token
}
@"
)
)
if
@project
.
save!
@project
.
reload
if
@project
.
import_failed?
@project
.
import_retry
else
@project
.
import_start
end
end
@project
).
execute
end
end
end
...
...
lib/gitlab/gitorious_import/project_creator.rb
View file @
99abbe7d
...
...
@@ -10,29 +10,16 @@ module Gitlab
end
def
execute
@project
=
Project
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
.
name
,
path:
repo
.
path
,
description:
repo
.
description
,
namespace:
namespace
,
creator:
current_user
,
namespace_id:
namespace
.
id
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
import_type:
"gitorious"
,
import_source:
repo
.
full_name
,
import_url:
repo
.
import_url
)
if
@project
.
save!
@project
.
reload
if
@project
.
import_failed?
@project
.
import_retry
else
@project
.
import_start
end
end
@project
).
execute
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment