Your Name ed9506de8b
Some checks failed
Gitea Actions Demo / Build (push) Failing after 5s
:-'Generic Commit'
2025-05-30 00:32:51 +12:00

33 lines
530 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
function die() {
echo "$1"
exit 1
}
function build_image() {
local dockerfile="$1"
local image_name="${dockerfile//Dockerfile./}"
docker build -t "$image_name:latest" -f "$dockerfile" . || die "Failed to build $image_name"
}
pids=()
for dockerfile in Dockerfile.*; do
(
build_image "$dockerfile"
) &
pids+=($!)
done
fail=0
for pid in "${pids[@]}"; do
wait "$pid" || fail=1
done
if (( fail )); then
echo "One or more builds failed."
exit 1
fi