Skip to content

Commit

Permalink
fix: ko
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly committed Oct 24, 2024
1 parent c35fa97 commit 9b78805
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ko-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ jobs:
- name: Run ko
run: |
set -e
KO_REGISTRY=ghcr.io/kyverno/kyverno-envoy-plugin make publish-ko
REGISTRY=ghcr.io \
REGISTRY_USERNAME=${{ github.actor }} \
REGISTRY_PASSWORD=${{ secrets.GITHUB_TOKEN }} \
make publish-ko
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ else
LD_FLAGS := "-s -w"
endif
KIND_IMAGE ?= kindest/node:v1.29.2
REGISTRY ?= ghcr.io
REPO ?= kyverno
IMAGE ?= kyverno-envoy-plugin
KO_REGISTRY ?= ko.local
KO_TAGS ?= $(GIT_SHA)
KO_PLATFORMS ?= all
Expand Down Expand Up @@ -125,6 +128,10 @@ build:
# BUILD (KO) #
##############

.PHONY: ko-login
ko-login: $(KO)
@$(KO) login $(REGISTRY) --username $(REGISTRY_USERNAME) --password $(REGISTRY_PASSWORD)

.PHONY: build-ko
build-ko: ## Build Docker image with ko
build-ko: fmt
Expand All @@ -139,7 +146,7 @@ publish-ko: fmt
publish-ko: vet
publish-ko: $(KO)
@echo "Publish Docker image with ko..." >&2
@LD_FLAGS=$(LD_FLAGS) KO_DOCKER_REPO=$(KO_REGISTRY) $(KO) build . --bare --tags=$(KO_TAGS) --platform=$(KO_PLATFORMS)
@LD_FLAGS=$(LD_FLAGS) KO_DOCKER_REPO=$(REGISTRY)/$(REPO)/$(IMAGE) $(KO) build . --bare --tags=$(KO_TAGS) --platform=$(KO_PLATFORMS)

########
# TEST #
Expand Down

0 comments on commit 9b78805

Please sign in to comment.