Skip to content

Commit

Permalink
Update curl-docker-tags.sh
Browse files Browse the repository at this point in the history
/build all

Signed-off-by: kuvaldini <ivan@kuvaldini.pro>
  • Loading branch information
kuvaldini committed Sep 1, 2021
1 parent 5e94730 commit e90a5f3
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions scripts/curl-docker-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,24 @@ repo=${1#*/}
org=${org:-hyperledger}
repo=${repo:-iroha}

curl -fsSL "https://registry.hub.docker.com/v2/repositories/$org/$repo/tags/?page_size=9999" |
cd $(mktemp -d)
trap "rm -rf $PWD" EXIT

declare -i page=1

while true ;do
curl -fsSL "https://registry.hub.docker.com/v2/repositories/$org/$repo/tags/?page_size=9999&page=$page" >page$page.json
if cat page$page.json | jq '.next==null' --exit-status >/dev/null
then break
fi
((page++))
done

jq -n '{ results: [ inputs.results ] | add }' page*.json >results.json

cat results.json |
jq -r '.results |
map(. | {name:.name, digest0:.images[0].digest})
map(. | {name:.name, last_updated:.last_updated, digest0:.images[0].digest})
| group_by(.digest0)
| map(. | {digest:.[0].digest0, names:map(.|.name)})[]
| .digest + " <- " + (.names|@csv) '
| map(. | {digest:.[0].digest0, last_updated:.[0].last_updated, names:map(.|.name)} )[]
| .last_updated +" -- "+ .digest +" <- "+ (.names|@csv)'

0 comments on commit e90a5f3

Please sign in to comment.