Skip to content

Commit

Permalink
improve build performance
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbaehler committed May 2, 2024
1 parent be36d7e commit 2767ee0
Show file tree
Hide file tree
Showing 2 changed files with 705 additions and 235 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Version
GIT_HEAD_COMMIT ?= $(shell git rev-parse --short HEAD)
VERSION ?= $(or $(shell git describe --abbrev=0 --tags --match "v*" 2>/dev/null),$(GIT_HEAD_COMMIT))
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)

# Defaults
REGISTRY ?= ghcr.io
Expand Down Expand Up @@ -181,6 +183,7 @@ dev-setup:
# -- Docker
####################

KO_PLATFORM ?= linux/$(GOARCH)
KOCACHE ?= /tmp/ko-cache
KO_REGISTRY := ko.local
KO_TAGS ?= "latest"
Expand All @@ -200,9 +203,9 @@ LD_FLAGS := "-X main.Version=$(VERSION) \

.PHONY: ko-build-capsule
ko-build-capsule: ko
@echo Building Capsule $(KO_TAGS) >&2
@echo Building Capsule $(KO_TAGS) for $(KO_PLATFORM) >&2
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(CAPSULE_IMG) \
$(KO) build ./ --bare --tags=$(KO_TAGS) --push=false --local
$(KO) build ./ --bare --tags=$(KO_TAGS) --push=false --local --platform=$(KO_PLATFORM)

.PHONY: ko-build-all
ko-build-all: ko-build-capsule
Expand Down
Loading

0 comments on commit 2767ee0

Please sign in to comment.