Skip to content

Commit

Permalink
Add operator helm chart to nightly release process
Browse files Browse the repository at this point in the history
  • Loading branch information
RafalKorepta committed Jan 8, 2025
1 parent 66f1912 commit cda3d10
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ genschema/genschema.xml
gotohelm/gotohelm.xml
pkg/pkg.xml

helm-operator-release/
1 change: 1 addition & 0 deletions taskfiles/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ tasks:
- task: :goreleaser:build-operator-binaries
- task: :k8s:build-and-push-operator-container-image
# Package and push Operator helm chart to Dockerhub
- task: :k8s:package-and-publish-operator-chart

assert-no-diffs:
desc: "Fail on any unexpected diffs to generated files (CI only)"
Expand Down
25 changes: 25 additions & 0 deletions taskfiles/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,28 @@ tasks:
cmds:
- 'echo "~~~ Creating operator v2 helm e2e tests :k8s:"'
- ./hack/v2-helm-setup.sh

package-and-publish-operator-chart:
vars:
TMP_PATH:
sh: mktemp --directory --tmpdir "helm-package-XXXXXXXXXX"
cmds:
- defer: 'rm -r {{.TMP_PATH}}'
- defer: 'helm registry logout registry-1.docker.io'
- helm registry login registry-1.docker.io -u {{.DOCKERHUB_USER}} --password {{.DOCKERHUB_TOKEN}}
- cp -r charts/operator/ {{.TMP_PATH}}
# The Chart.yaml name needs to match with docker hub OCI registry, so that helm push correctly
# finds OCI registry.
# Reference
# https://hub.docker.com/r/redpandadata/redpanda-operator-nightly
- yq -i '.name = "redpanda-operator-nightly"' {{.TMP_PATH}}/operator/Chart.yaml
# The version has suffix -helm-chart to overcome docker hub limitation of the oci artifact types
# Reference
# https://forums.docker.com/t/tag-overlap-in-oci-artifacts/131453
# For usage of operator artifact please go to specific reference like the one below
# https://hub.docker.com/layers/redpandadata/redpanda-operator-nightly/v0.0.0-20250104git4a5a076-helm-chart/images/sha256-ffaea8752b6bd00a26589a168830a87d498106e470f11af0f08267bc13fbd078
- helm package {{.TMP_PATH}}/operator --version "{{.TAG_NAME}}-helm-chart" --destination {{.TMP_PATH}} --dependency-update
- helm push `ls {{.TMP_PATH}}/redpanda-operator-nightly*.tgz` oci://registry-1.docker.io/redpandadata
preconditions:
- test -n "$DOCKERHUB_USER"
- test -n "$DOCKERHUB_TOKEN"

0 comments on commit cda3d10

Please sign in to comment.