Skip to content

Commit c6740c1

Browse files
authored
Merge pull request #736 from justinsb/run_helm_from_go_run
chore: run helm using go run
2 parents 9b2ab7f + 9637689 commit c6740c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ OCI_REPO ?= ghcr.io/kro-run/kro
33
HELM_IMAGE ?= ${OCI_REPO}
44
KO_DOCKER_REPO ?= ${OCI_REPO}/kro
55

6+
HELM ?= go run helm.sh/helm/v3/cmd/[email protected]
7+
68
KOCACHE ?= ~/.ko
79
KO_PUSH ?= true
810
export KIND_CLUSTER_NAME ?= kro
@@ -217,11 +219,11 @@ package-helm: ## Package Helm chart
217219
sed -i 's/tag: .*/tag: "$(RELEASE_VERSION)"/' helm/values.yaml
218220
sed -i 's/version: .*/version: $(RELEASE_VERSION)/' helm/Chart.yaml
219221
sed -i 's/appVersion: .*/appVersion: "$(RELEASE_VERSION)"/' helm/Chart.yaml
220-
helm package helm
222+
${HELM} package helm
221223

222224
.PHONY: publish-helm
223225
publish-helm: ## Helm publish
224-
helm push ./kro-${RELEASE_VERSION}.tgz oci://${HELM_IMAGE}
226+
${HELM} push ./kro-${RELEASE_VERSION}.tgz oci://${HELM_IMAGE}
225227

226228
.PHONY:
227229
release: build-image publish-image package-helm publish-helm
@@ -249,17 +251,17 @@ deploy-kind: ko
249251
make install
250252
# This generates deployment with ko://... used in image.
251253
# ko then intercepts it builds image, pushes to kind node, replaces the image in deployment and applies it
252-
helm template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true --set config.allowCRDDeletion=true | $(KO) apply -f -
254+
${HELM} template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true --set config.allowCRDDeletion=true | $(KO) apply -f -
253255
kubectl wait --for=condition=ready --timeout=1m pod -n kro-system -l app.kubernetes.io/component=controller
254256
$(KUBECTL) --context kind-${KIND_CLUSTER_NAME} get pods -A
255257

256258
.PHONY: ko-apply
257259
ko-apply: ko
258-
helm template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true | $(KO) apply -f -
260+
${HELM} template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true | $(KO) apply -f -
259261

260262
## CLI
261263
.PHONY: cli
262-
cli:
264+
cli:
263265
go build -o bin/kro cmd/kro/main.go
264266
sudo mv bin/kro /usr/local/bin
265267
@echo "CLI built successfully"

0 commit comments

Comments
 (0)