summaryrefslogtreecommitdiffstats
path: root/kubernetes/sdc
diff options
context:
space:
mode:
authorJakub Latusek <j.latusek@samsung.com>2020-09-24 19:07:10 +0200
committerJakub Latusek <j.latusek@samsung.com>2020-09-25 09:47:35 +0200
commit30801003a990bedda36b4f8aecd8ccc55eca5995 (patch)
treefe94fc94883235f733e1f80f35dedbe05fc8c579 /kubernetes/sdc
parent7d54df7a616bfb92045e63b75600f6924851292a (diff)
[SDC] Use helm-push plugin
Signed-off-by: Jakub Latusek <j.latusek@samsung.com> Issue-ID: OOM-2562 Change-Id: Ib39a3846020292cc4087947356d9d8e6247905d7
Diffstat (limited to 'kubernetes/sdc')
-rw-r--r--kubernetes/sdc/Makefile7
-rw-r--r--kubernetes/sdc/components/Makefile5
2 files changed, 12 insertions, 0 deletions
diff --git a/kubernetes/sdc/Makefile b/kubernetes/sdc/Makefile
index f2670c552d..3dab31fad0 100644
--- a/kubernetes/sdc/Makefile
+++ b/kubernetes/sdc/Makefile
@@ -20,6 +20,8 @@ SECRET_DIR := $(OUTPUT_DIR)/secrets
EXCLUDES := dist resources templates charts docker
HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
+HELM_VER := $(shell helm version --template "{{.Version}}")
+
.PHONY: $(EXCLUDES) $(HELM_CHARTS)
all: $(HELM_CHARTS)
@@ -39,7 +41,12 @@ 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:
diff --git a/kubernetes/sdc/components/Makefile b/kubernetes/sdc/components/Makefile
index 8d3bf2be4f..0d5b9e0c1f 100644
--- a/kubernetes/sdc/components/Makefile
+++ b/kubernetes/sdc/components/Makefile
@@ -19,6 +19,7 @@ SECRET_DIR := $(OUTPUT_DIR)/secrets
EXCLUDES :=
HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
+HELM_VER := $(shell helm version --template "{{.Version}}")
.PHONY: $(EXCLUDES) $(HELM_CHARTS)
@@ -39,7 +40,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: