Files
computer-playbook/scripts/github/runner/distros_matrix.sh
T
kevinveenbirkenbachandClaude Opus 4.7 ce48a8151a refactor(ci): extract images-build-ci inline blocks into runner SPOTs
Three inline `run:` blocks moved into `scripts/github/runner/`:

* `images_build_outputs.sh "$distros" "$image_tag"` — replaces the
  matrix/image_tag computation in the "Compute matrix JSON" step; emits
  both outputs to $GITHUB_OUTPUT in one call.
* `distros_matrix.sh "$distros"` — the matrix-JSON primitive
  (`split(" ") | map(select(length>0))`), reused by test-dns.yml's
  matrix step. Removes the jq duplicate that lived in both workflows.
* The two pre/post-build `Disk pressure` steps now invoke the already-
  existing `disk_pressure_report.sh PRE-BUILD` / `POST-BUILD` instead of
  duplicating the df/docker-system-df/buildx-du block inline.

Behaviour unchanged; the workflow runs the same commands via the SPOT
helpers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 04:01:39 +02:00

13 lines
394 B
Bash
Executable File

#!/usr/bin/env bash
#
# Emit a JSON array matrix from a space-separated distro list. Used by
# images-build-ci and test-dns workflows to feed the matrix strategy.
#
# Usage:
# distros_matrix.sh "arch debian ubuntu"
# echo "matrix=$(distros_matrix.sh "${INPUT}")" >> "$GITHUB_OUTPUT"
set -euo pipefail
distros="${1:-}"
printf '%s' "${distros}" | jq -Rc 'split(" ") | map(select(length>0))'