Commit f31a1f4e authored by Suzanne Selhorn's avatar Suzanne Selhorn

Merge branch 'docs/run-cleanup-policy-support-multiple-container-repos' into 'master'

Support multiple container repos on manual cleanup

See merge request gitlab-org/gitlab!41942
parents e3fac1a2 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:**
......
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