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
Léo-Paul Géneau
gitlab-ce
Commits
1322c981
Commit
1322c981
authored
May 10, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create import data in service
parent
3dc64764
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
17 deletions
+10
-17
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+2
-0
lib/gitlab/bitbucket_import/project_creator.rb
lib/gitlab/bitbucket_import/project_creator.rb
+2
-5
lib/gitlab/fogbugz_import/project_creator.rb
lib/gitlab/fogbugz_import/project_creator.rb
+3
-6
lib/gitlab/google_code_import/project_creator.rb
lib/gitlab/google_code_import/project_creator.rb
+3
-6
No files found.
app/services/projects/create_service.rb
View file @
1322c981
...
@@ -6,6 +6,7 @@ module Projects
...
@@ -6,6 +6,7 @@ module Projects
def
execute
def
execute
forked_from_project_id
=
params
.
delete
(
:forked_from_project_id
)
forked_from_project_id
=
params
.
delete
(
:forked_from_project_id
)
import_data
=
params
.
delete
(
:import_data
)
@project
=
Project
.
new
(
params
)
@project
=
Project
.
new
(
params
)
...
@@ -50,6 +51,7 @@ module Projects
...
@@ -50,6 +51,7 @@ module Projects
end
end
Project
.
transaction
do
Project
.
transaction
do
@project
.
create_or_update_import_data
(
data:
import_data
[
:data
],
credentials:
import_data
[
:credentials
])
if
import_data
@project
.
save
@project
.
save
if
@project
.
persisted?
&&
!
@project
.
import?
if
@project
.
persisted?
&&
!
@project
.
import?
...
...
lib/gitlab/bitbucket_import/project_creator.rb
View file @
1322c981
...
@@ -11,7 +11,7 @@ module Gitlab
...
@@ -11,7 +11,7 @@ module Gitlab
end
end
def
execute
def
execute
project
=
::
Projects
::
CreateService
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
current_user
,
name:
repo
[
"name"
],
name:
repo
[
"name"
],
path:
repo
[
"slug"
],
path:
repo
[
"slug"
],
...
@@ -21,11 +21,8 @@ module Gitlab
...
@@ -21,11 +21,8 @@ module Gitlab
import_type:
"bitbucket"
,
import_type:
"bitbucket"
,
import_source:
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
,
import_source:
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
,
import_url:
"ssh://git@bitbucket.org/
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
.git"
,
import_url:
"ssh://git@bitbucket.org/
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
.git"
,
import_data:
{
credentials:
{
bb_session:
session_data
}
}
).
execute
).
execute
project
.
create_or_update_import_data
(
credentials:
{
bb_session:
session_data
})
project
end
end
end
end
end
end
...
...
lib/gitlab/fogbugz_import/project_creator.rb
View file @
1322c981
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
end
end
def
execute
def
execute
project
=
::
Projects
::
CreateService
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
current_user
,
name:
repo
.
safe_name
,
name:
repo
.
safe_name
,
path:
repo
.
path
,
path:
repo
.
path
,
...
@@ -21,12 +21,9 @@ module Gitlab
...
@@ -21,12 +21,9 @@ module Gitlab
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
,
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
,
import_type:
'fogbugz'
,
import_type:
'fogbugz'
,
import_source:
repo
.
name
,
import_source:
repo
.
name
,
import_url:
Project
::
UNKNOWN_IMPORT_URL
import_url:
Project
::
UNKNOWN_IMPORT_URL
,
import_data:
{
data:
{
'repo'
=>
repo
.
raw_data
,
'user_map'
=>
user_map
},
credentials:
{
fb_session:
fb_session
}
}
).
execute
).
execute
project
.
create_or_update_import_data
(
data:
{
'repo'
=>
repo
.
raw_data
,
'user_map'
=>
user_map
},
credentials:
{
fb_session:
fb_session
})
project
end
end
end
end
end
end
...
...
lib/gitlab/google_code_import/project_creator.rb
View file @
1322c981
...
@@ -11,7 +11,7 @@ module Gitlab
...
@@ -11,7 +11,7 @@ module Gitlab
end
end
def
execute
def
execute
project
=
::
Projects
::
CreateService
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
current_user
,
name:
repo
.
name
,
name:
repo
.
name
,
path:
repo
.
name
,
path:
repo
.
name
,
...
@@ -21,12 +21,9 @@ module Gitlab
...
@@ -21,12 +21,9 @@ module Gitlab
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
import_type:
"google_code"
,
import_type:
"google_code"
,
import_source:
repo
.
name
,
import_source:
repo
.
name
,
import_url:
repo
.
import_url
import_url:
repo
.
import_url
,
import_data:
{
data:
{
'repo'
=>
repo
.
raw_data
,
'user_map'
=>
user_map
}
}
).
execute
).
execute
project
.
create_or_update_import_data
(
data:
{
'repo'
=>
repo
.
raw_data
,
'user_map'
=>
user_map
})
project
end
end
end
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