Skip to content

Commit 009c8f1

Browse files
authored
Merge pull request #612 from gman0/v2-push-charts
Rename konnector & backend charts to have `-v2` suffix. Also add gitlab CI job for pushing charts.
2 parents d78e581 + edd3c2f commit 009c8f1

34 files changed

Lines changed: 47 additions & 6 deletions

.github/workflows/image.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Image
22

3-
# Build and push the konnector + backend images. Pushes only on tags:
3+
# Build and push the konnector + backend images and Helm charts on tags:
44
# - tags v* -> ghcr.io/<owner>/konnector:<version>, ghcr.io/<owner>/backend:<version>
5+
# - tags v* -> oci://ghcr.io/kbind/charts/{konnector-v2,backend-v2}:<version>
56
# No :latest or :<sha> tags — the image repo is shared with v1/main images.
67
on:
78
push:
@@ -47,3 +48,21 @@ jobs:
4748
--push \
4849
.
4950
done
51+
52+
publish-chart:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
56+
57+
- name: Install Helm
58+
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
59+
60+
- name: Log in to GHCR for Helm
61+
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
62+
63+
- name: Version from tag
64+
id: v
65+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
66+
67+
- name: Package and push Helm charts (OCI)
68+
run: make helm-push VERSION=${{ steps.v.outputs.version }}

Makefile

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ CONTROLLER_GEN ?= go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2
1919
GOLANGCI_LINT ?= golangci-lint
2020
ENVTEST_K8S_VERSION ?= 1.34.1
2121
SETUP_ENVTEST ?= go run sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.21
22-
CHART ?= deploy/charts/konnector
23-
BACKEND_CHART ?= deploy/charts/backend
22+
CHART ?= deploy/charts/konnector-v2
23+
BACKEND_CHART ?= deploy/charts/backend-v2
2424
IMAGE ?= ghcr.io/kbind/konnector:dev
2525

2626
.PHONY: all
@@ -155,3 +155,25 @@ tilt-ci:
155155
tilt-down:
156156
kind delete cluster --name kbind-provider || true
157157
kind delete cluster --name kbind-consumer || true
158+
159+
# Helm publishing parameters
160+
HELM ?= helm
161+
HELM_REPO ?= ghcr.io/kbind/charts
162+
VERSION ?= 0.0.0-dev
163+
CHART_VERSION ?= $(VERSION)
164+
IMAGE_VERSION ?= $(VERSION)
165+
HELM_CHARTS ?= konnector-v2 backend-v2
166+
167+
## helm-push: Package and push Helm charts to $(HELM_REPO) as OCI artifacts
168+
.PHONY: helm-push
169+
helm-push:
170+
mkdir -p bin/charts
171+
@for chart in $(HELM_CHARTS); do \
172+
echo "==> packaging $$chart $(CHART_VERSION)"; \
173+
$(HELM) package deploy/charts/$$chart \
174+
--version $(CHART_VERSION) \
175+
--app-version $(IMAGE_VERSION) \
176+
--destination bin/charts || exit 1; \
177+
echo "==> pushing $$chart-$(CHART_VERSION).tgz to oci://$(HELM_REPO)"; \
178+
$(HELM) push bin/charts/$$chart-$(CHART_VERSION).tgz oci://$(HELM_REPO) || exit 1; \
179+
done
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
name: backend
2+
name: backend-v2
33
description: kbind v2 backend — the optional provider-side service layer (gateway, issuer, reaper).
44
type: application
55

deploy/charts/backend/files/crds/catalog.kbind.io_collections.yaml renamed to deploy/charts/backend-v2/files/crds/catalog.kbind.io_collections.yaml

File renamed without changes.

deploy/charts/backend/files/crds/catalog.kbind.io_exports.yaml renamed to deploy/charts/backend-v2/files/crds/catalog.kbind.io_exports.yaml

File renamed without changes.

deploy/charts/backend/files/crds/iam.kbind.io_grants.yaml renamed to deploy/charts/backend-v2/files/crds/iam.kbind.io_grants.yaml

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)