aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-06-28 19:19:25 +0000
committerGerrit Code Review <gerrit@onap.org>2021-06-28 19:19:25 +0000
commitc8a766a4fd2eda0b730cbe412d92d5a2c3092bec (patch)
tree3f0249a6e9dac6600b3ae3d18af311e6c69bc02b
parentae7b05560d7c7d59c7ceaa7d7e40bdce67e7d399 (diff)
parent48deb377b2b636734271f2129699db6c17b948d2 (diff)
Merge "[DCAE] Make sure to update index.yaml after pushing common chart"
-rw-r--r--kubernetes/dcaegen2-services/common/Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/kubernetes/dcaegen2-services/common/Makefile b/kubernetes/dcaegen2-services/common/Makefile
index 4a6491d8cc..db8704c2ca 100644
--- a/kubernetes/dcaegen2-services/common/Makefile
+++ b/kubernetes/dcaegen2-services/common/Makefile
@@ -22,11 +22,18 @@ HELM_REPO := local
EXCLUDES :=
HELM_BIN := helm
+# Helm v2 and helm v3 uses different version format so we first try in helm v3 format
+# and if it fails then we fallback to helm v2 one
+HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}" 2>/dev/null)
+ifneq "$(findstring v3,$(HELM_VER))" "v3"
+ HELM_VER := $(shell $(HELM_BIN) version -c --template "{{.Client.SemVer}}")
+endif
+
HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
.PHONY: $(EXCLUDES) $(HELM_CHARTS)
-all: $(HELM_CHARTS)
+all: $(HELM_CHARTS) helm-repo-update
$(HELM_CHARTS):
@echo "\n[$@]"
@@ -50,5 +57,11 @@ clean:
@rm -f */requirements.lock
@rm -f *tgz */charts/*tgz
@rm -rf $(PACKAGE_DIR)
+
+helm-repo-update:
+ifeq "$(findstring v3,$(HELM_VER))" "v3"
+ @$(HELM_BIN) repo update
+endif
+
%:
@: