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
0aab667b
Commit
0aab667b
authored
Sep 10, 2020
by
Anton Smith
Committed by
Suzanne Selhorn
Sep 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support multiple container repos on manual cleanup
parent
8ca6b163
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
doc/administration/packages/container_registry.md
doc/administration/packages/container_registry.md
+7
-3
No files found.
doc/administration/packages/container_registry.md
View file @
0aab667b
...
...
@@ -750,11 +750,15 @@ U = <user_id>
# Get required details / objects
user
=
User
.
find_by_id
(
U
)
project
=
Project
.
find_by_id
(
P
)
repo
=
ContainerRepository
.
find_by
(
project_id:
P
)
policy
=
ContainerExpirationPolicy
.
find_by
(
project_id:
P
)
# Start the tag cleanup
Projects
::
ContainerRepository
::
CleanupTagsService
.
new
(
project
,
user
,
policy
.
attributes
.
except
(
"created_at"
,
"updated_at"
)).
execute
(
repo
)
# Loop through each container repository
project
.
container_repositories
.
find_each
do
|
repo
|
puts
repo
.
attributes
# Start the tag cleanup
puts
Projects
::
ContainerRepository
::
CleanupTagsService
.
new
(
project
,
user
,
policy
.
attributes
.
except
(
"created_at"
,
"updated_at"
)).
execute
(
repo
)
end
```
NOTE:
**Note:**
...
...
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