Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ vars:
OPERATOR_CHART_VERSION:
# NB: OPERATOR_CHART_VERSION is currently only used for the operator chart's nightly releases.
sh: git describe --dirty --tags --match 'charts/operator/v*' --always | sed 's#^charts/operator/##'
CONSOLE_CHART_VERSION:
# NB: CONSOLE_CHART_VERSION is currently only used for the console chart's nightly releases.
sh: git describe --dirty --tags --match 'charts/console/v*' --always | sed 's#^charts/console/##'

includes:
build: taskfiles/build.yml
Expand Down
35 changes: 34 additions & 1 deletion taskfiles/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,40 @@ tasks:
- linux/arm64
CLI_ARGS: "--push"
# Package and push Operator helm chart to Dockerhub
- task: :k8s:package-and-publish-operator-chart
- task: publish:nightly:helm:chart
vars: {REPO: redpanda-operator-nightly, CHART: operator, VERSION: "{{ .OPERATOR_CHART_VERSION }}"}
- task: publish:nightly:helm:chart
vars: {REPO: console-unstable, CHART: console, VERSION: "{{ .CONSOLE_CHART_VERSION }}"}

publish:nightly:helm:chart:
desc: "Packages and pushes a helm chart to redpandadata's dockerhub account as an OCI artifact"
label: "publish:helm:chart:{{ .CHART }}"
requires:
vars: [CHART, VERSION, REPO]
vars:
TMP_PATH:
sh: mktemp --directory --tmpdir "helm-package-XXXXXXXXXX"
cmds:
- defer: 'rm -r {{.TMP_PATH}}'
# NB: cp -r/-R is dependent on the implementation (macOS vs Linux).
# cp -R src/. dest/ <- Same behavior, copy contents of src to dest.
# cp -r src/ dest <- Different. macOS == copy contents, linux == copy src folder into dest.
- cp -R charts/{{ .CHART }}/. {{.TMP_PATH}}
# `helm push`, to an OCI repo, uses `name` and `version` from Chart.yaml
# to determine where to push the chart to.
# i.e. `helm push chart.tgz oci://registry-1.docker.io/<org>` -> <org>/<chart.name>:<chart.version>
# name is set with `yq`
# version is set with `helm package`
- yq -i '.name = "{{ .REPO }}"' {{.TMP_PATH}}/Chart.yaml
# dockerhub has a limitation where oci artifacts may not share tags with images [1].
# We suffix versions with `-helm-chart` to work around this.
# [1]: https://forums.docker.com/t/tag-overlap-in-oci-artifacts/131453
- helm package {{.TMP_PATH}} --version "{{ .VERSION }}-helm-chart" --destination {{.BUILD_ROOT}} --dependency-update
- helm registry login registry-1.docker.io -u {{.DOCKERHUB_USER}} --password {{.DOCKERHUB_TOKEN}}
- defer: 'helm registry logout registry-1.docker.io'
# 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 push '{{.BUILD_ROOT}}/{{ .REPO }}-{{.VERSION}}-helm-chart.tgz' oci://registry-1.docker.io/redpandadata

set-aio-max:
internal: true
Expand Down
25 changes: 0 additions & 25 deletions taskfiles/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,3 @@ tasks:
cmds:
- mkdir -p {{.KUTTL_ARTIFACTS_DIR}}
- kuttl test --config "{{.KUTTL_CONFIG_FILE}}" {{.CLI_ARGS}}

package-and-publish-operator-chart:
vars:
TMP_PATH:
sh: mktemp --directory --tmpdir "helm-package-XXXXXXXXXX"
cmds:
- defer: 'rm -r {{.TMP_PATH}}'
# NB: cp -r/-R is dependent on the implementation (macOS vs Linux).
# cp -R src/. dest/ <- Same behavior, copy contents of src to dest.
# cp -r src/ dest <- Different. macOS == copy contents, linux == copy src folder into dest.
- 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}}/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}} --version "{{.OPERATOR_CHART_VERSION}}-helm-chart" --destination {{.BUILD_ROOT}} --dependency-update
- helm registry login registry-1.docker.io -u {{.DOCKERHUB_USER}} --password {{.DOCKERHUB_TOKEN}}
- defer: 'helm registry logout registry-1.docker.io'
- helm push '{{.BUILD_ROOT}}/redpanda-operator-nightly-{{.OPERATOR_CHART_VERSION}}-helm-chart.tgz' oci://registry-1.docker.io/redpandadata
Loading