Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 44f3814

Browse files
chore(makefile): use kocache, convert publish to build (#1488)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
1 parent 3f5d509 commit 44f3814

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,22 @@ clean:
124124
rm -rf sget
125125
rm -rf dist/
126126

127+
128+
KOCACHE_PATH=/tmp/ko
129+
130+
define create_kocache_path
131+
mkdir -p $(KOCACHE_PATH)
132+
endef
133+
134+
127135
##########
128136
# ko build
129137
##########
130138
.PHONY: ko
131139
ko:
140+
$(create_kocache_path)
132141
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
133-
ko publish --base-import-paths --bare \
142+
KOCACHE=$(KOCACHE_PATH) ko build --base-import-paths --bare \
134143
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
135144
github.com/sigstore/cosign/cmd/cosign
136145

@@ -142,14 +151,15 @@ ko:
142151

143152
# sget
144153
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
145-
ko publish --base-import-paths --bare \
154+
KOCACHE=$(KOCACHE_PATH) ko build --base-import-paths --bare \
146155
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
147156
github.com/sigstore/cosign/cmd/sget
148157

149158
.PHONY: ko-local
150159
ko-local:
160+
$(create_kocache_path)
151161
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
152-
ko publish --base-import-paths --bare \
162+
KOCACHE=$(KOCACHE_PATH) ko build --base-import-paths --bare \
153163
--tags $(GIT_VERSION) --tags $(GIT_HASH) --local \
154164
github.com/sigstore/cosign/cmd/cosign
155165

0 commit comments

Comments
 (0)