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
d46e9291
Commit
d46e9291
authored
Sep 10, 2021
by
Shem Gyll
Committed by
Marcel Amirault
Sep 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add section for returning single project's artifacts and associated job ID
parent
cca1122a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
doc/administration/job_artifacts.md
doc/administration/job_artifacts.md
+21
-0
No files found.
doc/administration/job_artifacts.md
View file @
d46e9291
...
...
@@ -435,6 +435,27 @@ Ci::JobArtifact.where(project: project).order(size: :desc).limit(50).map { |a| p
You can change the number of job artifacts listed by modifying
`.limit(50)`
to
the number you want.
#### List artifacts in a single project
List the artifacts for a single project, sorted by artifact size. The output includes the:
-
ID of the job that created the artifact
-
artifact size
-
artifact file type
-
artifact creation date
-
on-disk location of the artifact
```
ruby
p
=
Project
.
find_by_id
(
:project
ID
)
arts
=
Ci
::
JobArtifact
.
where
(
project:
p
)
list
=
arts
.
order
(
'sort DESC'
).
limit
(
50
).
each
do
|
art
|
puts
"Job ID:
#{
art
.
job_id
}
- Size:
#{
art
.
size
}
b - Type:
#{
art
.
file_type
}
- Created:
#{
art
.
created_at
}
- File loc:
#{
art
.
file
}
"
end
```
To change the number of projects listed, change the number in
`limit(50)`
.
#### Delete job artifacts from jobs completed before a specific date
WARNING:
...
...
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