Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ko build #41

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ else
LD_FLAGS := "-s -w"
endif
KIND_IMAGE ?= kindest/node:v1.29.2
KO_REGISTRY := ko.local
KO_TAGS := $(GIT_SHA)

#########
# TOOLS #
Expand Down Expand Up @@ -86,6 +88,33 @@ verify-codegen: codegen
@echo 'To correct this, locally run "make codegen", commit the changes, and re-run tests.' >&2
@git diff --quiet --exit-code -- .

#########
# BUILD #
#########

.PHONY: fmt
fmt: ## Run go fmt
@echo Go fmt... >&2
@go fmt ./...

.PHONY: vet
vet: ## Run go vet
@echo Go vet... >&2
@go vet ./...

##############
# BUILD (KO) #
##############

.PHONY: build-ko
build-ko: ## Build Docker image with ko
build-ko: fmt
build-ko: vet
build-ko: $(KO)
@echo "Build Docker image with ko..." >&2
@LD_FLAGS=$(LD_FLAGS) KO_DOCKER_REPO=$(KO_REGISTRY) \
$(KO) build . --preserve-import-paths --tags=$(KO_TAGS)

##########
# MKDOCS #
##########
Expand Down
File renamed without changes.