BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
30f4dcd4
Commit
30f4dcd4
authored
May 19, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uploads export
parent
a5f04ad4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
export_service.rb
app/services/projects/import_export/export_service.rb
+5
-1
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
def
execute
(
options
=
{})
@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?
end
...
...
@@ -18,6 +18,10 @@ module Projects
Gitlab
::
ImportExport
::
ProjectTreeSaver
.
new
(
project:
project
,
shared:
@shared
).
save
end
def
save_uploads
Gitlab
::
ImportExport
::
UploadsSaver
.
save
(
project:
project
,
shared:
@shared
)
end
def
bundle_repo
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
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
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