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
47a1593d
Commit
47a1593d
authored
Mar 29, 2018
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove support for legacy tar.gz pages artifacts
parent
1e4b9310
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
67 deletions
+51
-67
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+1
-13
spec/services/projects/update_pages_service_spec.rb
spec/services/projects/update_pages_service_spec.rb
+50
-54
No files found.
app/services/projects/update_pages_service.rb
View file @
47a1593d
...
...
@@ -74,25 +74,13 @@ module Projects
end
def
extract_archive!
(
temp_path
)
if
artifacts_filename
.
ends_with?
(
'.tar.gz'
)
||
artifacts_filename
.
ends_with?
(
'.tgz'
)
extract_tar_archive!
(
temp_path
)
elsif
artifacts_filename
.
ends_with?
(
'.zip'
)
if
artifacts_filename
.
ends_with?
(
'.zip'
)
extract_zip_archive!
(
temp_path
)
else
raise
InvaildStateError
,
'unsupported artifacts format'
end
end
def
extract_tar_archive!
(
temp_path
)
build
.
artifacts_file
.
use_file
do
|
artifacts_path
|
results
=
Open3
.
pipeline
(
%W(gunzip -c
#{
artifacts_path
}
)
,
%W(dd bs=
#{
BLOCK_SIZE
}
count=
#{
blocks
}
)
,
%W(tar -x -C
#{
temp_path
}
#{
SITE_PATH
}
)
,
err:
'/dev/null'
)
raise
FailedToExtractError
,
'pages failed to extract'
unless
results
.
compact
.
all?
(
&
:success?
)
end
end
def
extract_zip_archive!
(
temp_path
)
raise
InvaildStateError
,
'missing artifacts metadata'
unless
build
.
artifacts_metadata?
...
...
spec/services/projects/update_pages_service_spec.rb
View file @
47a1593d
...
...
@@ -21,10 +21,8 @@ describe Projects::UpdatePagesService do
end
context
'legacy artifacts'
do
%w(tar.gz zip)
.
each
do
|
format
|
let
(
:extension
)
{
format
}
let
(
:extension
)
{
'zip'
}
context
"for valid
#{
format
}
"
do
before
do
build
.
update_attributes
(
legacy_artifacts_file:
file
)
build
.
update_attributes
(
legacy_artifacts_metadata:
metadata
)
...
...
@@ -91,8 +89,6 @@ describe Projects::UpdatePagesService do
.
to
raise_error
(
Projects
::
UpdatePagesService
::
FailedToExtractError
)
end
end
end
end
context
'for new artifacts'
do
context
"for a valid job"
do
...
...
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