Skip to content

Commit

Permalink
Add target to install zot binary
Browse files Browse the repository at this point in the history
  • Loading branch information
frewilhelm committed Feb 7, 2025
1 parent 14087a0 commit e38aa6a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ else
GOBIN=$(shell go env GOBIN)
endif

OS ?= $(shell go env GOOS)
ARCH ?= $(shell go env GOARCH)


# CONTAINER_TOOL defines the container tool to be used for building images.
# Be aware that the target commands are only tested with Docker which is
# scaffolded by default. However, you might want to replace it to use other
Expand Down Expand Up @@ -64,7 +68,7 @@ vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: manifests generate envtest ## Run tests.
test: manifests generate envtest zot-registry ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
Expand Down Expand Up @@ -178,6 +182,7 @@ KUSTOMIZE_VERSION ?= v5.4.1
CONTROLLER_TOOLS_VERSION ?= v0.16.0
ENVTEST_VERSION ?= release-0.18
GOLANGCI_LINT_VERSION ?= v1.61.0
ZOT_VERSION ?= v2.1.2

## ZOT OCI Registry
ZOT_VERSION ?= v2.1.2
Expand Down Expand Up @@ -213,6 +218,12 @@ deploy-cert-manager: ## Deploy cert-manager to the K8s cluster specified in ~/.k
undeploy-cert-manager: ## Undeploy cert-manager from the K8s cluster specified in ~/.kube/config.
$(KUBECTL) delete --ignore-not-found=$(IGNORE_NOT_FOUND) -f $(CERT-MANAGER_YAML)

.PHONY: zot-registry
zot-registry: $(LOCALBIN) # Download zot registry binary locally if necessary.
@wget "https://github.com/project-zot/zot/releases/download/$(ZOT_VERSION)/zot-$(OS)-$(ARCH)-minimal" \
-O $(LOCALBIN)/zot-registry \
&& chmod u+x $(LOCALBIN)/zot-registry

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
Expand Down

0 comments on commit e38aa6a

Please sign in to comment.