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
Boxiang Sun
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
Show 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
def
execute
forked_from_project_id
=
params
.
delete
(
:forked_from_project_id
)
import_data
=
params
.
delete
(
:import_data
)
@project
=
Project
.
new
(
params
)
...
...
@@ -50,6 +51,7 @@ module Projects
end
Project
.
transaction
do
@project
.
create_or_update_import_data
(
data:
import_data
[
:data
],
credentials:
import_data
[
:credentials
])
if
import_data
@project
.
save
if
@project
.
persisted?
&&
!
@project
.
import?
...
...
lib/gitlab/bitbucket_import/project_creator.rb
View file @
1322c981
...
...
@@ -11,7 +11,7 @@ module Gitlab
end
def
execute
project
=
::
Projects
::
CreateService
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
[
"name"
],
path:
repo
[
"slug"
],
...
...
@@ -21,11 +21,8 @@ module Gitlab
import_type:
"bitbucket"
,
import_source:
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
,
import_url:
"ssh://git@bitbucket.org/
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
.git"
,
import_data:
{
credentials:
{
bb_session:
session_data
}
}
).
execute
project
.
create_or_update_import_data
(
credentials:
{
bb_session:
session_data
})
project
end
end
end
...
...
lib/gitlab/fogbugz_import/project_creator.rb
View file @
1322c981
...
...
@@ -12,7 +12,7 @@ module Gitlab
end
def
execute
project
=
::
Projects
::
CreateService
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
.
safe_name
,
path:
repo
.
path
,
...
...
@@ -21,12 +21,9 @@ module Gitlab
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
,
import_type:
'fogbugz'
,
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
project
.
create_or_update_import_data
(
data:
{
'repo'
=>
repo
.
raw_data
,
'user_map'
=>
user_map
},
credentials:
{
fb_session:
fb_session
})
project
end
end
end
...
...
lib/gitlab/google_code_import/project_creator.rb
View file @
1322c981
...
...
@@ -11,7 +11,7 @@ module Gitlab
end
def
execute
project
=
::
Projects
::
CreateService
.
new
(
::
Projects
::
CreateService
.
new
(
current_user
,
name:
repo
.
name
,
path:
repo
.
name
,
...
...
@@ -21,12 +21,9 @@ module Gitlab
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
import_type:
"google_code"
,
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
project
.
create_or_update_import_data
(
data:
{
'repo'
=>
repo
.
raw_data
,
'user_map'
=>
user_map
})
project
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