Use helm-push plugin 01/112701/2
authorJakub Latusek <j.latusek@samsung.com>
Mon, 14 Sep 2020 14:33:55 +0000 (16:33 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 16 Sep 2020 07:06:08 +0000 (07:06 +0000)
Helm3 remove serve command, instead developer suggest to use chartMuseum.
In makefile we check helm version and for helm3 we use
helm-push plugin to push chart package to local repository

Change-Id: I50800c4577140d6dcbd363142efdf625a5ea9e2e
Signed-off-by: Jakub Latusek <j.latusek@samsung.com>
Issue-ID: OOM-2562

kubernetes/common/Makefile

index 941c2f8..eb782b4 100644 (file)
@@ -22,6 +22,8 @@ COMMON_CHARTS_DIR := common
 EXCLUDES :=
 HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
 
+HELM_VER != helm version --template "{{.Version}}"
+
 .PHONY: $(EXCLUDES) $(HELM_CHARTS)
 
 all: $(COMMON_CHARTS_DIR) $(HELM_CHARTS)
@@ -41,7 +43,11 @@ lint-%: dep-%
 
 package-%: lint-%
        @mkdir -p $(PACKAGE_DIR)
+ifeq "$(findstring v3,$(HELM_VER))" "v3"
+       @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$(helm package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && helm push -f $$PACKAGE_NAME local; fi
+else
        @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi
+endif
        @helm repo index $(PACKAGE_DIR)
 
 clean: