From d64189d859ffa7eccf03b02c9a6fbe7b628df3b6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 30 May 2025 00:28:07 +1200 Subject: [PATCH] :-'Generic Commit' --- build.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 780d6d3..0709f1f 100755 --- a/build.sh +++ b/build.sh @@ -8,14 +8,20 @@ function build_image() { docker build -t "$image_name:latest" -f "$dockerfile" . } -# iterate through the docker files in format Dockerfile.IMAGE_NAME -for dockerfile in Dockerfile.* -do +pids=() +for dockerfile in Dockerfile.*; do ( build_image "$dockerfile" ) & + pids+=($!) done -wait - +fail=0 +for pid in "${pids[@]}"; do + wait "$pid" || fail=1 +done +if (( fail )); then + echo "One or more builds failed." + exit 1 +fi