generate the DockerHub image matrix
This commit is contained in:
parent
e9633d0d58
commit
8cbbfe7009
6 changed files with 73 additions and 5 deletions
30
dockerhub-image-matrix
Executable file
30
dockerhub-image-matrix
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Usage: ./dockerhub-image-matrix
|
||||
set -euo pipefail
|
||||
|
||||
microbadge() {
|
||||
local name=$1
|
||||
local tag=${2:-latest}
|
||||
|
||||
if [[ $tag != latest ]]; then
|
||||
name=$name:$tag
|
||||
fi
|
||||
|
||||
# make sure that microbadger has loaded the image
|
||||
curl -o /dev/null -sfL "https://microbadger.com/images/$name"
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
## Main ##
|
||||
|
||||
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
|
||||
|
||||
echo "| Image / Tag | latest | nixos-18.09 |"
|
||||
echo "| --- | --- | --- |"
|
||||
|
||||
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
|
||||
name=nixpkgs/$attr
|
||||
echo "| [$name](https://hub.docker.com/r/$name) | $(microbadge "$name") | $(microbadge "$name" "nixos-18.09") |"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue