Skip to content
Snippets Groups Projects
Unverified Commit 829cc80e authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Delete artifacts for pages unless expiry date is specified

parent 8a5557ce
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -34,6 +34,8 @@ module Projects
end
rescue => e
error(e.message)
ensure
build.erase_artifacts! unless build.has_expiring_artifacts?
end
 
private
Loading
Loading
---
title: Delete artifacts for pages unless expiry date is specified
merge_request:
author:
Loading
Loading
@@ -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 expiry time.
### Image
 
At this point, you probably ask yourself: "okay, but to install Jekyll
Loading
Loading
Loading
Loading
@@ -26,6 +26,26 @@ describe Projects::UpdatePagesService do
build.update_attributes(artifacts_metadata: metadata)
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
expect(project.pages_deployed?).to be_falsey
expect(execute).to eq(:success)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment