@@ -305,27 +305,26 @@ build-deps: manifests generate fmt
305305.PHONY : build go-build-local
306306build : build-deps go-build-local # HELP Build manager binary for current GOOS and GOARCH. Default target.
307307go-build-local : BUILDBIN := bin
308- go-build-local : $(BINARIES )
308+ go-build-local : $(BINARIES ) go-build-catalogd-local
309309
310310.PHONY : build-linux go-build-linux
311311build-linux : build-deps go-build-linux # EXHELP Build manager binary for GOOS=linux and local GOARCH.
312312go-build-linux : BUILDBIN := bin/linux
313313go-build-linux : export GOOS=linux
314314go-build-linux : export GOARCH=amd64
315- go-build-linux : $(BINARIES )
315+ go-build-linux : $(BINARIES ) go-build-catalogd-linux
316316
317317.PHONY : run
318- run : docker-build kind-cluster kind-load kind-deploy wait # HELP Build the operator-controller then deploy it into a new kind cluster.
318+ run : docker-build kind-cluster kind-load-catalogd kind-load kind-deploy wait # HELP Build the operator-controller then deploy it into a new kind cluster.
319319
320320CATALOGD_NAMESPACE := olmv1-system
321321wait :
322322 kubectl wait --for=condition=Available --namespace=$(CATALOGD_NAMESPACE ) deployment/catalogd-controller-manager --timeout=60s
323323 kubectl wait --for=condition=Ready --namespace=$(CATALOGD_NAMESPACE ) certificate/catalogd-service-cert # Avoid upgrade test flakes when reissuing cert
324324
325325.PHONY : docker-build
326- docker-build : build-linux # EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
326+ docker-build : build-linux build-catalogd-container # EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
327327 $(CONTAINER_RUNTIME ) build -t $(IMG ) -f Dockerfile ./bin/linux
328- IMAGE_REPO=$(CATALOG_IMAGE_REPO ) $(MAKE ) -f Makefile.catalogd build-container
329328
330329# SECTION Release
331330ifeq ($(origin ENABLE_RELEASE_PIPELINE ) , undefined)
@@ -389,4 +388,44 @@ deploy-docs: venv
389388demo-update :
390389 ./hack/demo/generate-asciidemo.sh -u -n catalogd-demo catalogd-demo-script.sh
391390
391+ # Catalogd targets
392+ ifeq ($(origin CATALOGD_IMAGE_REPO ) , undefined)
393+ CATALOGD_IMAGE_REPO := quay.io/operator-framework/catalogd
394+ endif
395+ export CATALOGD_IMAGE_REPO
396+
397+ ifeq ($(origin CATALOGD_IMAGE_TAG ) , undefined)
398+ CATALOGD_IMAGE_TAG := devel
399+ endif
400+ export CATALOGD_IMAGE_TAG
401+
402+ CATALOGD_IMAGE := $(CATALOGD_IMAGE_REPO ) :$(CATALOGD_IMAGE_TAG )
403+
404+ CATALOGD_BINARIES =catalogd
405+ LINUX_BINARIES =$(join $(addprefix linux/,$(CATALOGD_BINARIES ) ) , )
406+
407+ BUILDCMD = go build -tags '$(GO_BUILD_TAGS ) ' -ldflags '$(GO_BUILD_LDFLAGS ) ' -gcflags '$(GO_BUILD_GCFLAGS ) ' -asmflags '$(GO_BUILD_ASMFLAGS ) ' -o $(BUILDBIN ) /$(notdir $@ ) ./cmd/$(notdir $@ )
408+
409+ .PHONY : catalogd-build go-build-catalogd-local $(CATALOGD_BINARIES )
410+ catalogd-build : go-build-catalogd-local # # Build binaries for current GOOS and GOARCH.
411+ go-build-catalogd-local : $(CATALOGD_BINARIES )
412+ $(CATALOGD_BINARIES ) : BUILDBIN = bin
413+ $(CATALOGD_BINARIES ) :
414+ $(BUILDCMD )
415+
416+ .PHONY : catalogd-build-linux go-build-catalogd-linux $(LINUX_BINARIES )
417+ catalogd-build-linux : go-build-catalogd-linux # # Build binaries for GOOS=linux and local GOARCH.
418+ go-build-catalogd-linux : $(LINUX_BINARIES )
419+ $(LINUX_BINARIES ) : BUILDBIN = bin/linux
420+ $(LINUX_BINARIES ) :
421+ GOOS=linux $(BUILDCMD )
422+
423+ .PHONY : build-catalogd-container
424+ build-catalogd-container : catalogd-build-linux # # Build docker image for catalogd.
425+ $(CONTAINER_RUNTIME ) build -f Dockerfile.catalogd -t $(CATALOGD_IMAGE ) ./bin/linux
426+
427+ .PHONY : kind-load-catalogd
428+ kind-load-catalogd : $(KIND ) # # Load the built images onto the local cluster
429+ $(CONTAINER_RUNTIME ) save $(CATALOGD_IMAGE ) | $(KIND ) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME )
430+
392431include Makefile.venv
0 commit comments