32 lines
861 B
Bash
Executable file
32 lines
861 B
Bash
Executable file
#!/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
|
|
|
|
local homepage=https://microbadger.com/images/$name
|
|
|
|
# make sure that microbadger has loaded the image
|
|
curl -o /dev/null -sfL "$homepage"
|
|
|
|
echo "[]($homepage)"
|
|
}
|
|
|
|
## Main ##
|
|
|
|
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
|
|
|
|
echo "| Image / Tag | latest | nixos-19.03 | nixos-19.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-19.03") | $(microbadge "$name" "nixos-19.09") |"
|
|
done
|