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
c5bc2629
Commit
c5bc2629
authored
Apr 28, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few fixes - import from UI working
parent
5908bdf3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
3 deletions
+6
-3
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+3
-1
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+1
-1
lib/gitlab/import_export/command_line_util.rb
lib/gitlab/import_export/command_line_util.rb
+1
-1
lib/gitlab/import_export/saver.rb
lib/gitlab/import_export/saver.rb
+1
-0
No files found.
app/controllers/projects_controller.rb
View file @
c5bc2629
...
...
@@ -191,6 +191,7 @@ class ProjectsController < Projects::ApplicationController
end
def
export
#TODO: Move to worker
::
Projects
::
ImportExport
::
ExportService
.
new
(
@project
,
current_user
).
execute
redirect_to
(
...
...
@@ -267,6 +268,7 @@ class ProjectsController < Projects::ApplicationController
def
export_project_path
# TODO: move this, probably to ImportExport and refactor
File
.
join
(
Settings
.
shared
[
'path'
],
'tmp/project_exports'
,
@project
.
path_with_namespace
,
'project.tar.gz'
)
folder
=
File
.
join
(
Settings
.
shared
[
'path'
],
'tmp/project_exports'
,
@project
.
path_with_namespace
)
Dir
.
glob
(
"
#{
folder
}
/*export.tar.gz"
).
max_by
{
|
f
|
File
.
ctime
(
f
)}
end
end
app/services/projects/import_export/export_service.rb
View file @
c5bc2629
...
...
@@ -3,7 +3,7 @@ module Projects
class
ExportService
<
BaseService
def
execute
(
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
project
.
path_with_namespace
)
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
)
)
save_project_tree
bundle_repo
save_all
...
...
lib/gitlab/import_export/command_line_util.rb
View file @
c5bc2629
...
...
@@ -24,7 +24,7 @@ module Gitlab
end
def
tar_with_options
(
archive
:,
dir
:,
options
:)
cmd
=
%W(tar -
#{
options
}
#{
archive
}
#{
dir
}
)
cmd
=
%W(tar -
#{
options
}
#{
archive
}
-C
#{
dir
}
.
)
_output
,
status
=
Gitlab
::
Popen
.
popen
(
cmd
)
status
.
zero?
end
...
...
lib/gitlab/import_export/saver.rb
View file @
c5bc2629
...
...
@@ -14,6 +14,7 @@ module Gitlab
def
save
if
compress_and_save
remove_storage_path
Rails
.
logger
.
info
(
"Saved project export
#{
archive_file
}
"
)
archive_file
else
false
...
...
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