summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Latusek <j.latusek@samsung.com>2020-09-25 10:45:59 +0200
committerJakub Latusek <j.latusek@samsung.com>2020-09-25 10:51:51 +0200
commitdd13b4d3e8f37153f3ca3de2571059210dd8c64f (patch)
tree12eb7166a64f43c91ee6ce1a7d4c3fc739f714e8
parent7d54df7a616bfb92045e63b75600f6924851292a (diff)
[SDNC] Use helm-push plugin
Signed-off-by: Jakub Latusek <j.latusek@samsung.com> Issue-ID: OOM-2562 Change-Id: I2c09ef07a3445e8eb199011cdc2aa0a9d3647dcf
-rw-r--r--kubernetes/sdnc/Makefile5
-rw-r--r--kubernetes/sdnc/components/Makefile5
2 files changed, 10 insertions, 0 deletions
diff --git a/kubernetes/sdnc/Makefile b/kubernetes/sdnc/Makefile
index e4b5dda95d..1518f3c3c6 100644
--- a/kubernetes/sdnc/Makefile
+++ b/kubernetes/sdnc/Makefile
@@ -20,6 +20,7 @@ SECRET_DIR := $(OUTPUT_DIR)/secrets
EXCLUDES := dist resources templates charts
HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
+HELM_VER := $(shell helm version --template "{{.Version}}")
.PHONY: $(EXCLUDES) $(HELM_CHARTS)
@@ -40,7 +41,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:
diff --git a/kubernetes/sdnc/components/Makefile b/kubernetes/sdnc/components/Makefile
index 4e737638a6..c38171c1e5 100644
--- a/kubernetes/sdnc/components/Makefile
+++ b/kubernetes/sdnc/components/Makefile
@@ -20,6 +20,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)
@@ -40,7 +41,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: