forked from puppetlabs-toy-chest/puppet-in-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcounts
executable file
·31 lines (26 loc) · 843 Bytes
/
counts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# This scripts prints the list of images along with download counts
# from Docker Hub, and at the end prints the total number of downloads
declare -a arr=(puppet-agent
puppet-agent-alpine
puppet-agent-ubuntu
puppet-agent-debian
puppet-agent-centos
facter
puppetserver-standalone
puppetserver
puppetdb
puppetdb-postgres
puppetboard
puppet-inventory
)
date
sum=0
for image in "${arr[@]}"
do
count=$(curl -s https://registry.hub.docker.com/v2/repositories/puppet/"$image"/ | jq .pull_count)
printf "%-25s %s\n" "$image" "$count"
sum=`expr "$sum" + "$count"`
done
echo --------------------------------
printf "%-25s %s\n" Total "$sum"