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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
30f4dcd4
Commit
30f4dcd4
authored
May 19, 2016
by
James Lopez
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uploads export
parent
a5f04ad4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+5
-1
lib/gitlab/import_export/uploads_saver.rb
lib/gitlab/import_export/uploads_saver.rb
+35
-0
No files found.
app/services/projects/import_export/export_service.rb
View file @
30f4dcd4
...
@@ -4,7 +4,7 @@ module Projects
...
@@ -4,7 +4,7 @@ module Projects
def
execute
(
options
=
{})
def
execute
(
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
save_all
if
[
save_version
,
save_project_tree
,
bundle_repo
,
bundle_wiki_repo
].
all?
save_all
if
[
save_version
,
save_project_tree
,
save_uploads
,
bundle_repo
,
bundle_wiki_repo
].
all?
cleanup_and_notify_worker
if
@shared
.
errors
.
any?
cleanup_and_notify_worker
if
@shared
.
errors
.
any?
end
end
...
@@ -18,6 +18,10 @@ module Projects
...
@@ -18,6 +18,10 @@ module Projects
Gitlab
::
ImportExport
::
ProjectTreeSaver
.
new
(
project:
project
,
shared:
@shared
).
save
Gitlab
::
ImportExport
::
ProjectTreeSaver
.
new
(
project:
project
,
shared:
@shared
).
save
end
end
def
save_uploads
Gitlab
::
ImportExport
::
UploadsSaver
.
save
(
project:
project
,
shared:
@shared
)
end
def
bundle_repo
def
bundle_repo
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
end
end
...
...
lib/gitlab/import_export/uploads_saver.rb
0 → 100644
View file @
30f4dcd4
module
Gitlab
module
ImportExport
class
UploadsSaver
def
self
.
save
(
*
args
)
new
(
*
args
).
save
end
def
initialize
(
project
:,
shared
:)
@project
=
project
@shared
=
shared
end
def
save
return
true
unless
File
.
directory?
(
uploads_path
)
FileUtils
.
copy_entry
(
uploads_path
,
uploads_export_path
)
true
rescue
=>
e
@shared
.
error
(
e
.
message
)
false
end
private
def
uploads_export_path
File
.
join
(
@shared
.
export_path
,
'uploads'
)
end
def
uploads_path
File
.
join
(
Rails
.
root
.
join
(
'public/uploads'
),
project
.
path_with_namespace
)
end
end
end
end
Alain Takoudjou
@alain.takoudjou
mentioned in commit
bac27df1
·
May 03, 2017
mentioned in commit
bac27df1
mentioned in commit bac27df16c35abb2f8115d9c94edcc4ecbace1a7
Toggle commit list
Alain Takoudjou
@alain.takoudjou
mentioned in commit
bac27df1
·
May 03, 2017
mentioned in commit
bac27df1
mentioned in commit bac27df16c35abb2f8115d9c94edcc4ecbace1a7
Toggle commit list
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