@@ -315,27 +315,26 @@ build-deps: manifests generate fmt
315315.PHONY : build go-build-local
316316build : build-deps go-build-local # HELP Build manager binary for current GOOS and GOARCH. Default target.
317317go-build-local : BUILDBIN := bin
318- go-build-local : $(BINARIES )
318+ go-build-local : $(BINARIES ) go-build-catalogd-local
319319
320320.PHONY : build-linux go-build-linux
321321build-linux : build-deps go-build-linux # EXHELP Build manager binary for GOOS=linux and local GOARCH.
322322go-build-linux : BUILDBIN := bin/linux
323323go-build-linux : export GOOS=linux
324324go-build-linux : export GOARCH=amd64
325- go-build-linux : $(BINARIES )
325+ go-build-linux : $(BINARIES ) go-build-catalogd-linux
326326
327327.PHONY : run
328- run : docker-build kind-cluster kind-load kind-deploy wait # HELP Build the operator-controller then deploy it into a new kind cluster.
328+ 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.
329329
330330CATALOGD_NAMESPACE := olmv1-system
331331wait :
332332 kubectl wait --for=condition=Available --namespace=$(CATALOGD_NAMESPACE ) deployment/catalogd-controller-manager --timeout=60s
333333 kubectl wait --for=condition=Ready --namespace=$(CATALOGD_NAMESPACE ) certificate/catalogd-service-cert # Avoid upgrade test flakes when reissuing cert
334334
335335.PHONY : docker-build
336- docker-build : build-linux # EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
336+ docker-build : build-linux build-catalogd-container # EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
337337 $(CONTAINER_RUNTIME ) build -t $(IMG ) -f Dockerfile ./bin/linux
338- IMAGE_REPO=$(CATALOG_IMAGE_REPO ) $(MAKE ) -f Makefile.catalogd build-container
339338
340339# SECTION Release
341340ifeq ($(origin ENABLE_RELEASE_PIPELINE ) , undefined)
@@ -392,4 +391,44 @@ deploy-docs: venv
392391demo-update :
393392 ./hack/demo/generate-asciidemo.sh -u -n catalogd-demo catalogd-demo-script.sh
394393
394+ # Catalogd targets
395+ ifeq ($(origin CATALOGD_IMAGE_REPO ) , undefined)
396+ CATALOGD_IMAGE_REPO := quay.io/operator-framework/catalogd
397+ endif
398+ export CATALOGD_IMAGE_REPO
399+
400+ ifeq ($(origin CATALOGD_IMAGE_TAG ) , undefined)
401+ CATALOGD_IMAGE_TAG := devel
402+ endif
403+ export CATALOGD_IMAGE_TAG
404+
405+ CATALOGD_IMAGE := $(CATALOGD_IMAGE_REPO ) :$(CATALOGD_IMAGE_TAG )
406+
407+ CATALOGD_BINARIES =catalogd
408+ LINUX_BINARIES =$(join $(addprefix linux/,$(CATALOGD_BINARIES ) ) , )
409+
410+ BUILDCMD = go build -tags '$(GO_BUILD_TAGS ) ' -ldflags '$(GO_BUILD_LDFLAGS ) ' -gcflags '$(GO_BUILD_GCFLAGS ) ' -asmflags '$(GO_BUILD_ASMFLAGS ) ' -o $(BUILDBIN ) /$(notdir $@ ) ./cmd/$(notdir $@ )
411+
412+ .PHONY : catalogd-build go-build-catalogd-local $(CATALOGD_BINARIES )
413+ catalogd-build : go-build-catalogd-local # # Build binaries for current GOOS and GOARCH.
414+ go-build-catalogd-local : $(CATALOGD_BINARIES )
415+ $(CATALOGD_BINARIES ) : BUILDBIN = bin
416+ $(CATALOGD_BINARIES ) :
417+ $(BUILDCMD )
418+
419+ .PHONY : catalogd-build-linux go-build-catalogd-linux $(LINUX_BINARIES )
420+ catalogd-build-linux : go-build-catalogd-linux # # Build binaries for GOOS=linux and local GOARCH.
421+ go-build-catalogd-linux : $(LINUX_BINARIES )
422+ $(LINUX_BINARIES ) : BUILDBIN = bin/linux
423+ $(LINUX_BINARIES ) :
424+ GOOS=linux $(BUILDCMD )
425+
426+ .PHONY : build-catalogd-container
427+ build-catalogd-container : catalogd-build-linux # # Build docker image for catalogd.
428+ $(CONTAINER_RUNTIME ) build -f Dockerfile.catalogd -t $(CATALOGD_IMAGE ) ./bin/linux
429+
430+ .PHONY : kind-load-catalogd
431+ kind-load-catalogd : $(KIND ) # # Load the built images onto the local cluster
432+ $(CONTAINER_RUNTIME ) save $(CATALOGD_IMAGE ) | $(KIND ) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME )
433+
395434include Makefile.venv
0 commit comments