@@ -7,7 +7,10 @@ SHELL := $(shell which bash 2>/dev/null || echo /bin/sh)
77FILES := $(shell find . -type f -name metadata.hcl)
88DIRS := $(patsubst % /,% ,$(patsubst ./% ,% ,$(dir $(FILES ) ) ) )
99
10- .PHONY : all check prereqs push $(DIRS )
10+ # Create push targets for each directory
11+ PUSH_TARGETS := $(addprefix push-,$(DIRS ) )
12+
13+ .PHONY : all check prereqs push $(DIRS ) $(PUSH_TARGETS )
1114
1215# Colours
1316GREEN := \033[0;32m
@@ -44,15 +47,16 @@ check: prereqs
4447# --------------------------
4548# Push all images
4649# --------------------------
47- push : all
48- @echo -e " $( BLUE) Performing bake --push for all projects...$( NC) "
49- @$(foreach dir,$(DIRS ) , $(MAKE ) push-$(dir ) DRY_RUN=$(DRY_RUN ) ;)
50+ push : all $(PUSH_TARGETS )
51+ @echo -e " $( GREEN) ======================================================$( NC) "
52+ @echo -e " $( GREEN) Push successful for all projects: $( DIRS) $( NC) "
53+ @echo -e " $( GREEN) ======================================================$( NC) "
5054
5155# --------------------------
5256# Generic per-project push
5357# Usage: make push-<project>
5458# --------------------------
55- push-% : prereqs
59+ $( PUSH_TARGETS ) : push-% : prereqs
5660 @echo -e " $( BLUE) Performing bake --push for $* ...$( NC) "
5761ifeq ($(DRY_RUN ) ,true)
5862 @echo -e "$(GREEN)[DRY RUN] docker buildx bake -f $*/metadata.hcl -f docker-bake.hcl --push$(NC)"
0 commit comments