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
28774dff
Commit
28774dff
authored
Apr 06, 2018
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove differences with CE version of update_pages_service.rb
parent
e0c77b31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+6
-6
No files found.
app/services/projects/update_pages_service.rb
View file @
28774dff
...
@@ -74,7 +74,7 @@ module Projects
...
@@ -74,7 +74,7 @@ module Projects
end
end
def
extract_archive!
(
temp_path
)
def
extract_archive!
(
temp_path
)
if
artifacts
_filename
.
ends_with?
(
'.zip'
)
if
artifacts
.
ends_with?
(
'.zip'
)
extract_zip_archive!
(
temp_path
)
extract_zip_archive!
(
temp_path
)
else
else
raise
InvaildStateError
,
'unsupported artifacts format'
raise
InvaildStateError
,
'unsupported artifacts format'
...
@@ -97,7 +97,7 @@ module Projects
...
@@ -97,7 +97,7 @@ module Projects
# We add * to end of SITE_PATH, because we want to extract SITE_PATH and all subdirectories
# We add * to end of SITE_PATH, because we want to extract SITE_PATH and all subdirectories
site_path
=
File
.
join
(
SITE_PATH
,
'*'
)
site_path
=
File
.
join
(
SITE_PATH
,
'*'
)
build
.
artifacts_file
.
use_file
do
|
artifacts_path
|
build
.
artifacts_file
.
use_file
do
|
artifacts_path
|
unless
system
(
*
%W(unzip -
qq -
n
#{
artifacts_path
}
#{
site_path
}
-d
#{
temp_path
}
)
)
unless
system
(
*
%W(unzip -n
#{
artifacts_path
}
#{
site_path
}
-d
#{
temp_path
}
)
)
raise
FailedToExtractError
,
'pages failed to extract'
raise
FailedToExtractError
,
'pages failed to extract'
end
end
end
end
...
@@ -130,10 +130,6 @@ module Projects
...
@@ -130,10 +130,6 @@ module Projects
1
+
max_size
/
BLOCK_SIZE
1
+
max_size
/
BLOCK_SIZE
end
end
def
artifacts_filename
build
.
artifacts_file
.
filename
end
def
max_size
def
max_size
max_pages_size
=
Gitlab
::
CurrentSettings
.
max_pages_size
.
megabytes
max_pages_size
=
Gitlab
::
CurrentSettings
.
max_pages_size
.
megabytes
...
@@ -162,6 +158,10 @@ module Projects
...
@@ -162,6 +158,10 @@ module Projects
build
.
ref
build
.
ref
end
end
def
artifacts
build
.
artifacts_file
.
path
end
def
delete_artifact!
def
delete_artifact!
build
.
reload
# Reload stable object to prevent erase artifacts with old state
build
.
reload
# Reload stable object to prevent erase artifacts with old state
build
.
erase_artifacts!
unless
build
.
has_expiring_artifacts?
build
.
erase_artifacts!
unless
build
.
has_expiring_artifacts?
...
...
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