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
21d53985
Commit
21d53985
authored
Mar 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'delete-pages' into 'master'
Delete artifacts for pages unless expiry date is specified See merge request !9716
parents
ae8a0665
8f227f23
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
0 deletions
+31
-0
update_pages_service.rb
app/services/projects/update_pages_service.rb
+2
-0
delete-artifacts-for-pages.yml
changelogs/unreleased/delete-artifacts-for-pages.yml
+4
-0
getting_started_part_four.md
doc/user/project/pages/getting_started_part_four.md
+3
-0
update_pages_service_spec.rb
spec/services/projects/update_pages_service_spec.rb
+22
-0
No files found.
app/services/projects/update_pages_service.rb
View file @
21d53985
...
...
@@ -34,6 +34,8 @@ module Projects
end
rescue
=>
e
error
(
e
.
message
)
ensure
build
.
erase_artifacts!
unless
build
.
has_expiring_artifacts?
end
private
...
...
changelogs/unreleased/delete-artifacts-for-pages.yml
0 → 100644
View file @
21d53985
---
title
:
Delete artifacts for pages unless expiry date is specified
merge_request
:
9716
author
:
doc/user/project/pages/getting_started_part_four.md
View file @
21d53985
...
...
@@ -133,6 +133,9 @@ your Jekyll 3.4.0 site with GitLab Pages. This is the minimum
configuration for our example. On the steps below, we'll refine
the script by adding extra options to our GitLab CI.
Artifacts will be automatically deleted once GitLab Pages got deployed.
You can preserve artifacts for limited time by specifying the expiry time.
### Image
At this point, you probably ask yourself: "okay, but to install Jekyll
...
...
spec/services/projects/update_pages_service_spec.rb
View file @
21d53985
...
...
@@ -26,6 +26,28 @@ describe Projects::UpdatePagesService do
build
.
update_attributes
(
artifacts_metadata:
metadata
)
end
describe
'pages artifacts'
do
context
'with expiry date'
do
before
do
build
.
artifacts_expire_in
=
"2 days"
end
it
"doesn't delete artifacts"
do
expect
(
execute
).
to
eq
(
:success
)
expect
(
build
.
reload
.
artifacts_file?
).
to
eq
(
true
)
end
end
context
'without expiry date'
do
it
"does delete artifacts"
do
expect
(
execute
).
to
eq
(
:success
)
expect
(
build
.
reload
.
artifacts_file?
).
to
eq
(
false
)
end
end
end
it
'succeeds'
do
expect
(
project
.
pages_deployed?
).
to
be_falsey
expect
(
execute
).
to
eq
(
:success
)
...
...
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