Skip to content

Commit bf0dd4f

Browse files
committed
chore: do not spawn sub-makes
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent a4ff35c commit bf0dd4f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ SHELL := $(shell which bash 2>/dev/null || echo /bin/sh)
77
FILES := $(shell find . -type f -name metadata.hcl)
88
DIRS := $(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
1316
GREEN := \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)"
5761
ifeq ($(DRY_RUN),true)
5862
@echo -e "$(GREEN)[DRY RUN] docker buildx bake -f $*/metadata.hcl -f docker-bake.hcl --push$(NC)"

0 commit comments

Comments
 (0)