Skip to content

Commit 4670cd6

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
makefile: add build-image that more directly wraps build-image script
The build-*{server,ad-server,client,toolbox} rules are good for humans and discoverability but are a bit too rigid for how we want to work with matrix builds in automation. Add a new build-image rule that more directly wraps the build-image tool and so that it becomes fairly easy to directly pass the four primary inputs to the tool (kind, package source, distro base (aka OS), and arch). Signed-off-by: John Mulligan <[email protected]>
1 parent c6afd5c commit 4670cd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ BUILDFILE_AD_SERVER=$(shell $(call _BUILD_KP,ad-server,default,--print-buildfile
3737
BUILDFILE_NIGHTLY_AD_SERVER=$(shell $(call _BUILD_KP,ad-server,nightly,--print-buildfile))
3838
BUILDFILE_CLIENT=$(shell $(call _BUILD_KP,client,default,--print-buildfile))
3939
BUILDFILE_TOOLBOX=$(shell $(call _BUILD_KP,toolbox,default,--print-buildfile))
40+
DYN_BUILDFILE=$(shell $(call _BUILD_KP,$(KIND),$(if $(PACKAGE_SOURCE),$(PACKAGE_SOURCE),default),--print-buildfile) 2>/dev/null || echo invalid)
4041

4142
REPO_BASE=quay.io/samba.org/
4243

@@ -77,6 +78,13 @@ debug-vars:
7778

7879
### Image Build and Push Rules ###
7980

81+
build-image: $(DYN_BUILDFILE)
82+
.PHONY: build-image
83+
84+
$(DYN_BUILDFILE):
85+
@[ "$(KIND)" ] || (echo "KIND must be specfied"; exit 1)
86+
$(call _BUILD_KP,$(KIND),$(if $(PACKAGE_SOURCE),$(PACKAGE_SOURCE),default)) $(EXTRA_BUILD_ARGS)
87+
8088
build-server: $(BUILDFILE_SERVER)
8189
.PHONY: build-server
8290
$(BUILDFILE_SERVER): Makefile $(SERVER_SRC_FILE) $(SERVER_SOURCES)

0 commit comments

Comments
 (0)