Created
February 27, 2017 19:16
-
-
Save darron/63d81a4db2160d72b2a8d796e4c0a9e3 to your computer and use it in GitHub Desktop.
Figure out which repos in ECR are empty.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export REPOS=$(aws ecr describe-repositories | jq '.repositories | .[].repositoryName' | cut -d'"' -f 2) | |
for repo in $REPOS; | |
do | |
IMAGES=$(aws ecr list-images --repository-name $repo | grep imageDigest) | |
if [[ "$?" -eq "1" ]] | |
then | |
echo "$repo: empty" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment