Skip to content

Commit

Permalink
feat: add ko build
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
eddycharly committed Mar 12, 2024
1 parent aa8b7cf commit c29938f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
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.

0 comments on commit c29938f

Please sign in to comment.