Merge pull request #15587 from travisn/backport-push-to-oci

ci: Publish helm charts to the OCI registries docker, quay, and ghcr (backport #15542)
This commit is contained in:
subham rai authored and GitHub committed 2025-03-26 06:47:15 +05:30
commit 522e048f40
9 files changed
+47 -9

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.6.2
version: v3.17.1
- name: build rook
run: |
+1 -1
View File
@@ -33,7 +33,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.6.2
version: v3.17.1
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
-1
View File
@@ -190,7 +190,6 @@ gen-rbac: $(HELM) $(YQ) ## Generate RBAC from Helm charts
@# output only stdout to the file; stderr for debugging should keep going to stderr
HELM=$(HELM) ./build/rbac/gen-common.sh
HELM=$(HELM) ./build/rbac/gen-nfs-rbac.sh
HELM=$(HELM) ./build/rbac/gen-psp.sh
gen.docs: docs
docs: helm-docs
+1 -1
View File
@@ -36,7 +36,7 @@ OLM_CATALOG_DIR="${DESTINATION_ROOT}/deploy/olm/deploy/crds"
CEPH_CRDS_FILE_PATH="${DESTINATION_ROOT}/deploy/examples/crds.yaml"
CEPH_HELM_CRDS_FILE_PATH="${DESTINATION_ROOT}/deploy/charts/rook-ceph/templates/resources.yaml"
if [[ "$($YQ_BIN_PATH --version)" != "yq (https://github.com/mikefarah/yq/) version 4."* ]]; then
if [[ "$($YQ_BIN_PATH --version)" != "yq (https://github.com/mikefarah/yq/) version v4."* ]]; then
echo "yq must be version 4.x"
exit 1
fi
+1 -1
View File
@@ -222,7 +222,7 @@ $(CONTROLLER_GEN):
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
YQ_VERSION = v4.14.2
YQ_VERSION = v4.45.1
YQ := $(TOOLS_HOST_DIR)/yq-$(YQ_VERSION)
export YQ
$(YQ):
+1 -1
View File
@@ -20,7 +20,7 @@ HELM_CHARTS_DIR ?= $(ROOT_DIR)/deploy/charts
HELM_OUTPUT_DIR ?= $(OUTPUT_DIR)/charts
HELM_HOME := $(abspath $(CACHE_DIR)/helm)
HELM_VERSION := v3.6.2
HELM_VERSION := v3.17.1
HELM := $(TOOLS_HOST_DIR)/helm-$(HELM_VERSION)
HELM_INDEX := $(HELM_OUTPUT_DIR)/index.yaml
export HELM_HOME
+1 -1
View File
@@ -9,7 +9,7 @@ KEEP_FILE="$2"
: ${YQ:=yq}
if [[ "$($YQ --version)" != "yq (https://github.com/mikefarah/yq/) version 4."* ]]; then
if [[ "$($YQ --version)" != "yq (https://github.com/mikefarah/yq/) version v4."* ]]; then
echo "yq must be version 4.x"
exit 1
fi
+1 -1
View File
@@ -7,7 +7,7 @@ set -eEuo pipefail
: ${YQ:=yq}
if [[ "$($YQ --version)" != "yq (https://github.com/mikefarah/yq/) version 4."* ]]; then
if [[ "$($YQ --version)" != "yq (https://github.com/mikefarah/yq/) version v4."* ]]; then
echo "yq must be version 4.x"
exit 1
fi
+40 -1
View File
@@ -59,8 +59,10 @@ REMOTE_NAME ?= origin
PLATFORMS ?= $(ALL_PLATFORMS)
# "helm" flavor is for pushing to s3/https endpoint
# "charts" flavor is for pushing to oci endpoint
ifneq ($(filter master release-%,$(BRANCH_NAME)),)
FLAVORS ?= output images docs helm
FLAVORS ?= output images docs helm charts
else
FLAVORS ?= output
override BRANCH_NAME := pr/$(BRANCH_NAME)
@@ -156,6 +158,39 @@ promote.helm: $(HELM)
$(S3_SYNC_DEL) $(HELM_TEMP) s3://$(HELM_S3_BUCKET)/$(CHANNEL)
rm -fr $(HELM_TEMP)
# set the helm cart version number.
# you should not need to do this for the majority of scenarios.
ifeq ($(origin HELM_CHART_VERSION), undefined)
# this changes the third '.' to a '-':
# example v1.16.0.371.g4aec70601 -> v1.16.0-371.g4aec70601
# as helm has strict rules on allowable versions to comply with SemVer2
HELM_CHART_VERSION := $(shell echo "$(VERSION)" | sed 's/\./-/3' )
endif
export HELM_CHART_VERSION
# we need to re-package the charts with the HELM_CHART_VERSION,
# as there is a difference with the helm charts that was
# created during the release scripts
define chart.build
build.chart.$(1):
@echo === helm package $(1)
mkdir -p $(HELM_OUTPUT_DIR)
$(HELM) package --version $(HELM_CHART_VERSION) --app-version $(VERSION) $(HELM_CHARTS_DIR)/$(1) --destination $(HELM_OUTPUT_DIR)
build.all.charts: build.chart.$(1)
clean.chart.$(1):
@rm -fr $(HELM_OUTPUT_DIR)/$(1)-$(HELM_CHART_VERSION).tgz
clean.all.charts: clean.chart.$(1)
endef
$(foreach c,$(HELM_CHARTS),$(eval $(call chart.build,$(c))))
define chart.targets
promote.chart.$(1).$(2):
@echo === helm push $(2) to $(1)
$(HELM) push $(HELM_OUTPUT_DIR)/$(2)-$(HELM_CHART_VERSION).tgz oci://$(1)
promote.all.charts: promote.chart.$(1).$(2)
endef
$(foreach r,$(REGISTRIES), $(foreach c,$(HELM_CHARTS),$(eval $(call chart.targets,$(r),$(c)))))
# ====================================================================================
# output
@@ -207,6 +242,10 @@ publish.images: $(addprefix publish.manifest.image.,$(IMAGES))
promote.images: $(addprefix promote.manifest.image.,$(IMAGES))
clean.images: clean.all.images
build.charts: build.all.charts
promote.charts: promote.all.charts
clean.charts: clean.all.charts
# ====================================================================================
# Help