Skip to content

Commit 0b3e72a

Browse files
committed
package and push helm chart
1 parent e5f06bd commit 0b3e72a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ jobs:
8787
run: |
8888
IMG=ghcr.io/openmcp-project/metrics-operator:${{ env.version }} make docker-buildx docker-push
8989
90+
- name: Package and push helm chart
91+
run: |
92+
make helm-package helm-push
93+
9094
- name: setup OCM
9195
uses: open-component-model/ocm-setup-action@main
9296

Makefile

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
145145
ENVTEST ?= $(LOCALBIN)/setup-envtest
146146
GOTESTSUM ?= $(LOCALBIN)/gotestsum
147147
GOLANGCILINT ?= $(LOCALBIN)/golangci-lint
148-
149-
148+
HELM ?= $(LOCALBIN)/helm
150149

151150
## Tool Versions
152151
KUSTOMIZE_VERSION ?= v5.4.1
@@ -255,6 +254,29 @@ docker-buildx: ## Build and tag docker image for each platform locally using --l
255254
$(CONTAINER_TOOL) buildx rm project-v3-builder
256255
rm Dockerfile.cross
257256

257+
#----------------------------------------------------------------------------------------------
258+
##@ Helm
259+
HELM_VERSION ?= v3.18.0
260+
OCI_REGISTRY ?= ghcr.io/sap/charts
261+
262+
$(HELM): $(LOCALBIN)
263+
@if test -x $(LOCALBIN)/helm && ! $(LOCALBIN)/helm version --short | grep -q $(HELM_VERSION); then \
264+
echo "$(LOCALBIN)/helm version is not expected $(HELM_VERSION). Removing it before installing."; \
265+
rm -rf $(LOCALBIN)/helm; \
266+
fi
267+
test -s $(LOCALBIN)/helm || (curl -sSL https://get.helm.sh/helm-$(HELM_VERSION)-$(shell uname | tr '[:upper:]' '[:lower:]')-amd64.tar.gz | tar xz -C /tmp && \
268+
mv /tmp/$(shell uname | tr '[:upper:]' '[:lower:]')-amd64/helm $(LOCALBIN)/helm && \
269+
chmod +x $(LOCALBIN)/helm && \
270+
rm -rf /tmp/$(shell uname | tr '[:upper:]' '[:lower:]')-amd64)
271+
272+
.PHONY: helm-package
273+
helm-package: $(HELM) helm-chart
274+
$(LOCALBIN)/helm package charts/$(PROJECT_FULL_NAME)/ -d ./ --version $(shell cat VERSION)
275+
276+
.PHONY: helm-push
277+
helm-push: $(HELM)
278+
$(LOCALBIN)/helm push $(PROJECT_FULL_NAME)-$(shell cat VERSION).tgz oci://$(OCI_REGISTRY)
279+
258280
#----------------------------------------------------------------------------------------------
259281
##@ Deployment
260282
.PHONY: install

0 commit comments

Comments
 (0)