From e6a8014ba2bd36dba710f757c08812df3f42c515 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 17 Mar 2022 10:06:11 -0700 Subject: [PATCH] Only build test-tools when needed --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 905b1c0..8305e32 100644 --- a/Makefile +++ b/Makefile @@ -192,9 +192,12 @@ test: $(BUILD_DIRS) " @./test_e2e.sh -test-tools: - @docker build -t $(REGISTRY)/test/test-sshd _test_tools/sshd - @docker build -t $(REGISTRY)/test/test-ncsvr _test_tools/ncsvr +TEST_TOOLS := $(shell ls _test_tools) +test-tools: $(foreach tool, $(TEST_TOOLS), .container.test_tool.$(tool)) + +.container.test_tool.%: _test_tools/% _test_tools/%/* + @docker build -t $(REGISTRY)/test/$$(basename $<) $< + @docker images -q $(REGISTRY)/test/$$(basename $<) > $@ # Help set up multi-arch build tools. This assumes you have the tools # installed. If you already have a buildx builder available, you don't need