X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2FMakefile;h=d994397269d8cdcdb7837f6d8c0c81fc7e714ba1;hb=f46b67ceca21bfd573ec924494b8b9651430f06e;hp=3c5254ca27309dc6cdec00527d1c9d8ef30a9622;hpb=4606cec636914dc93d5ba09be64e376d6f224984;p=oom.git diff --git a/kubernetes/Makefile b/kubernetes/Makefile index 3c5254ca27..d994397269 100644 --- a/kubernetes/Makefile +++ b/kubernetes/Makefile @@ -20,7 +20,14 @@ OUTPUT_DIR := $(ROOT_DIR)/dist PACKAGE_DIR := $(OUTPUT_DIR)/packages SECRET_DIR := $(OUTPUT_DIR)/secrets HELM_BIN := helm -HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}") + +# 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 + # use this if you would like to push onap charts to repo with other name # WARNING: Helm v3+ only # WARNING: Make sure to edit also requirements files @@ -38,7 +45,7 @@ HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.) .PHONY: $(EXCLUDES) $(HELM_CHARTS) check-for-staging-images -all: $(COMMON_CHARTS_DIR) $(SUBMODS) $(HELM_CHARTS) helm-repo-update plugins +all: print_helm_bin $(COMMON_CHARTS_DIR) $(SUBMODS) $(HELM_CHARTS) helm-repo-update plugins $(COMMON_CHARTS): @echo "\n[$@]" @@ -59,6 +66,8 @@ submod-%: %/requirements.yaml: $(error Submodule $* needs to be retrieved from gerrit. See https://wiki.onap.org/display/DW/OOM+-+Development+workflow+after+code+transfer+to+tech+teams ); fi +print_helm_bin: + $(info Using Helm binary ${HELM_BIN} which is helm version ${HELM_VER}) make-%: @if [ -f $*/Makefile ]; then make -C $*; fi