## Summary - Replace git-tag-triggered container builds with path-based triggers on main and workflow_dispatch - Image tags now encode upstream app version + commit SHA (`vX.Y.Z-<sha>`) for full traceability - Replace `container-tag-and-release` task with `container-build-and-release` (dispatches workflows via Forgejo API) - Update dagger `publish()` to accept `commit_sha` parameter - Update all docs and references to the new workflow ## Deployment and Testing - [ ] Merge to main - [ ] `mise run container-build-and-release <name>` for each container to populate new-format tags - [ ] Verify tags in registry via `mise run container-list` - [ ] Existing images untouched — old tags remain available Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/232
62 lines
1.7 KiB
Bash
Executable file
62 lines
1.7 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 trigger a build:"
|
|
echo " mise run container-build-and-release <container>"
|
|
echo ""
|
|
echo "Dispatches both Dockerfile and Nix workflows (each skips if build file absent)."
|
|
echo "Tags: vX.Y.Z-<sha> (Dockerfile), vX.Y.Z-<sha>-nix (Nix)"
|
|
echo ""
|
|
echo "Example:"
|
|
echo " mise run container-build-and-release nettest"
|