Commit 9b874a3b authored by Harish Ramachandran's avatar Harish Ramachandran Committed by Marcel Amirault

Removed a duplicate script from the docs

parent 941621b7
...@@ -572,29 +572,7 @@ Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count ...@@ -572,29 +572,7 @@ Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count
### Remove artifacts more than a week old ### Remove artifacts more than a week old
The Latest version of these steps can be found in the [job artifacts documentation](../job_artifacts.md) This section has been moved to the [job artifacts troubleshooting documentation](../job_artifacts.md#delete-job-artifacts-from-jobs-completed-before-a-specific-date).
```ruby
### SELECTING THE BUILDS TO CLEAR
# For a single project:
project = Project.find_by_full_path('')
builds_with_artifacts = project.builds.with_downloadable_artifacts
# Instance-wide:
builds_with_artifacts = Ci::Build.with_downloadable_artifacts
# Prior to 10.6 the above lines would be:
# builds_with_artifacts = project.builds.with_artifacts
# builds_with_artifacts = Ci::Build.with_artifacts
### CLEAR THEM OUT
# Note that this will also erase artifacts that developers marked to "Keep"
builds_to_clear = builds_with_artifacts.where("finished_at < ?", 1.week.ago)
builds_to_clear.each do |build|
build.artifacts_expire_at = Time.now
build.erase_erasable_artifacts!
end
```
### Find reason failure (for when build trace is empty) (Introduced in 10.3.0) ### Find reason failure (for when build trace is empty) (Introduced in 10.3.0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment