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
829cc80e
Commit
829cc80e
authored
Mar 05, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete artifacts for pages unless expiry date is specified
parent
8a5557ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
0 deletions
+29
-0
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+2
-0
changelogs/unreleased/delete-artifacts-for-pages.yml
changelogs/unreleased/delete-artifacts-for-pages.yml
+4
-0
doc/user/project/pages/getting_started_part_four.md
doc/user/project/pages/getting_started_part_four.md
+3
-0
spec/services/projects/update_pages_service_spec.rb
spec/services/projects/update_pages_service_spec.rb
+20
-0
No files found.
app/services/projects/update_pages_service.rb
View file @
829cc80e
...
@@ -34,6 +34,8 @@ module Projects
...
@@ -34,6 +34,8 @@ module Projects
end
end
rescue
=>
e
rescue
=>
e
error
(
e
.
message
)
error
(
e
.
message
)
ensure
build
.
erase_artifacts!
unless
build
.
has_expiring_artifacts?
end
end
private
private
...
...
changelogs/unreleased/delete-artifacts-for-pages.yml
0 → 100644
View file @
829cc80e
---
title
:
Delete artifacts for pages unless expiry date is specified
merge_request
:
author
:
doc/user/project/pages/getting_started_part_four.md
View file @
829cc80e
...
@@ -133,6 +133,9 @@ your Jekyll 3.4.0 site with GitLab Pages. This is the minimum
...
@@ -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
configuration for our example. On the steps below, we'll refine
the script by adding extra options to our GitLab CI.
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 expiry time.
### Image
### Image
At this point, you probably ask yourself: "okay, but to install Jekyll
At this point, you probably ask yourself: "okay, but to install Jekyll
...
...
spec/services/projects/update_pages_service_spec.rb
View file @
829cc80e
...
@@ -26,6 +26,26 @@ describe Projects::UpdatePagesService do
...
@@ -26,6 +26,26 @@ describe Projects::UpdatePagesService do
build
.
update_attributes
(
artifacts_metadata:
metadata
)
build
.
update_attributes
(
artifacts_metadata:
metadata
)
end
end
context
'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
it
'succeeds'
do
expect
(
project
.
pages_deployed?
).
to
be_falsey
expect
(
project
.
pages_deployed?
).
to
be_falsey
expect
(
execute
).
to
eq
(
:success
)
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