Allow to pass custom helm charts version

* Allow to pass custom helm chart version during build like
    make all version=1.2.3+custom123
* add get-version target that allows to get version based on
  number of git commits in format <git-tag>+<commits number>

Change-Id: I1f04aeaa8dd49dfa2ed1d76aabd54a0d5bf8f573
This commit is contained in:
Vasyl Saienko 2024-09-24 06:34:31 +00:00
parent 0b1ae682e0
commit 8807cd8189

View File

@ -12,10 +12,14 @@
# It's necessary to set this because some environments don't link sh -> bash. # It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash SHELL := /bin/bash
HELM := helm HELM := helm
TASK := build TASK := build
PKG_ARGS =
ifdef VERSION
PKG_ARGS += --version $(VERSION)
endif
EXCLUDES := helm-toolkit doc tests tools logs tmp roles playbooks releasenotes zuul.d EXCLUDES := helm-toolkit doc tests tools logs tmp roles playbooks releasenotes zuul.d
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
@ -36,7 +40,7 @@ lint-%: init-%
if [ -d $* ]; then $(HELM) lint $*; fi if [ -d $* ]; then $(HELM) lint $*; fi
build-%: lint-% build-%: lint-%
if [ -d $* ]; then $(HELM) package $*; fi if [ -d $* ]; then $(HELM) package $* $(PKG_ARGS); fi
clean: clean:
@echo "Removed .b64, _partials.tpl, and _globals.tpl files" @echo "Removed .b64, _partials.tpl, and _globals.tpl files"