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
cc72b37c
Commit
cc72b37c
authored
Sep 03, 2021
by
Alvin Gounder
Committed by
Craig Norris
Sep 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update doc to get list of tags via rails console
parent
68ee227a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
doc/user/packages/container_registry/index.md
doc/user/packages/container_registry/index.md
+12
-0
No files found.
doc/user/packages/container_registry/index.md
View file @
cc72b37c
...
@@ -865,6 +865,18 @@ these steps:
...
@@ -865,6 +865,18 @@ these steps:
echo
-n
""
>
list_o_tags.out
;
for
i
in
{
1..N
}
;
do
curl
--header
'PRIVATE-TOKEN: <PAT>'
"https://gitlab.example.com/api/v4/projects/<Project_id>/registry/repositories/<container_repo_id>/tags?per_page=100&page=
${
i
}
"
| jq
'.[].name'
|
sed
's:^.\(.*\).$:\1:'
>>
list_o_tags.out
;
done
echo
-n
""
>
list_o_tags.out
;
for
i
in
{
1..N
}
;
do
curl
--header
'PRIVATE-TOKEN: <PAT>'
"https://gitlab.example.com/api/v4/projects/<Project_id>/registry/repositories/<container_repo_id>/tags?per_page=100&page=
${
i
}
"
| jq
'.[].name'
|
sed
's:^.\(.*\).$:\1:'
>>
list_o_tags.out
;
done
```
```
If you have Rails console access, you can enter the following commands to retrieve a list of tags limited by date:
```
shell
output
=
File.open
(
"/tmp/list_o_tags.out"
,
"w"
)
Project.find
(
<Project_id>
)
.container_repositories.find
(
<container_repo_id>
)
.tags.each
do
|tag|
output
<<
tag
.name + "
\n
" if tag.created_at < 1.month.ago
end;nil
output.close
```
This set of commands creates a
`/tmp/list_o_tags.out`
file listing all tags with a
`created_at`
date of older than one month.
1.
Remove from the
`list_o_tags.out`
file any tags that you want to keep. Here are some example
1.
Remove from the
`list_o_tags.out`
file any tags that you want to keep. Here are some example
`sed`
commands for this. Note that these commands are simply examples. You may change them to
`sed`
commands for this. Note that these commands are simply examples. You may change them to
best suit your needs:
best suit your needs:
...
...
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