best-flower-4610003/09/2023, 4:07 PM
flag and grep "v-.\*" on the output - the problem with this solution is that we prefer to see regular logs in pipeline for debugging and monitoring progress and in this way we'd only see json. - Fetch info from one of the logs in
- the problem here is that grepping gets even more complex and it's relying on the log structure and wording to stay the same which doesn't seem reliable and would be difficult to track Is there any other method you could recommend?
bright-policeman-4362603/09/2023, 5:43 PM
This command returns the images that don't include the tag v-*. Then to delete them you can use subshells to do something like: *Note: * Please test this in a different repository first and see if it solves the problem you have, running
gcloud artifacts docker images list $YOUR_REPO_PATH --include-tags --filter='NOT tags~"^v-"'
is a really destructive command, please try to play around with the filters before executing the following command
docker images delete
gcloud artifacts docker images delete $(gcloud artifacts docker images list $YOUR_REPO_PATH --include-tags --filter='NOT tags~"^v-"')
best-flower-4610003/09/2023, 9:50 PM
bright-policeman-4362603/09/2023, 9:58 PM
best-flower-4610003/09/2023, 10:14 PM
bright-policeman-4362603/16/2023, 4:34 AM