blumeops/mise-tasks/container-list
Erich Blume e7f6a71e9b
All checks were successful
Build Container (Nix) / build (push) Successful in 6s
Build Container / build (push) Successful in 12s
Simplify container tagging: one tag triggers all workflows
Both the Dockerfile and Nix workflows now trigger on the same tag
pattern (*-v[0-9]*). Each workflow checks for its build file and
skips if not present. This eliminates the need for separate -nix-
tags and --nix/--dockerfile flags in the release script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 08:33:35 -08:00

61 lines
1.6 KiB
Bash
Executable file

#!/usr/bin/env bash
#MISE description="List available containers and their recent tags"
set -euo pipefail
REGISTRY="registry.ops.eblu.me"
CONTAINER_DIR="containers"
echo "Container Images"
echo "================"
echo ""
# Find all container directories with Dockerfiles or default.nix
for dir in "$CONTAINER_DIR"/*/; do
[[ -d "$dir" ]] || continue
# Determine available build types
has_dockerfile=false
has_nix=false
[[ -f "$dir/Dockerfile" ]] && has_dockerfile=true
[[ -f "$dir/default.nix" ]] && has_nix=true
# Skip directories with no build files
$has_dockerfile || $has_nix || continue
# Build type label
types=()
$has_dockerfile && types+=("dockerfile")
$has_nix && types+=("nix")
label=$(IFS=+; echo "${types[*]}")
# Extract container name from directory
container=$(basename "$dir")
image="blumeops/$container"
echo "[$label] $container"
echo " Image: $REGISTRY/$image"
echo " Path: $dir"
# Query zot for recent tags
tags=$(curl -sf "https://$REGISTRY/v2/$image/tags/list" 2>/dev/null | jq -r '.tags // [] | .[]' | grep -E '^v[0-9]' | sort -V | tail -4 || true)
if [[ -n "$tags" ]]; then
echo " Recent tags:"
echo "$tags" | while read -r tag; do
echo " - $tag"
done
else
echo " Recent tags: (none)"
fi
echo ""
done
echo "---"
echo "To release a new version:"
echo " mise run container-tag-and-release <container> <version>"
echo ""
echo "One tag triggers all applicable workflows (dockerfile and/or nix)."
echo ""
echo "Example:"
echo " mise run container-tag-and-release nettest v1.0.0"