docker-nixpkgs/dockerhub-image-matrix
zimbatm f90912f967
release.nix -> default.nix
the default should be to build all the images
2019-12-17 23:35:43 +01:00

32 lines
847 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 "[![](https://images.microbadger.com/badges/image/$name.svg)]($homepage)"
}
## Main ##
releases_json=$(nix-instantiate --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