Update Makefile
Per [0], update Makefile to behave as it was before with an added check(s) for the existence of a folder prior to processing. This allows us to reinstate the helm-toolkit folder even though it has been migrated, and will build as usual if a developer has a helm- toolkit in the directory. Also, did some minor cleanup to the Makefile. [0] https://review.openstack.org/#/c/568177/1 Change-Id: I4e0a26b4a228d63a1c769d2f0c935fa3fc56192c Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
30
Makefile
30
Makefile
@@ -14,39 +14,37 @@
|
|||||||
|
|
||||||
# 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
|
||||||
|
TASK := build
|
||||||
|
|
||||||
HELM := helm
|
EXCLUDES := helm-toolkit doc tests tools logs tmp
|
||||||
TASK := build
|
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
|
||||||
|
|
||||||
EXCLUDES := doc tests tools logs tmp
|
|
||||||
CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
|
|
||||||
|
|
||||||
.PHONY: $(EXCLUDES) $(CHARTS)
|
.PHONY: $(EXCLUDES) $(CHARTS)
|
||||||
|
|
||||||
all: $(CHARTS)
|
all: $(CHARTS)
|
||||||
|
|
||||||
$(CHARTS):
|
$(CHARTS):
|
||||||
@echo
|
@if [ -d $@ ]; then \
|
||||||
@echo "===== Processing [$@] chart ====="
|
echo; \
|
||||||
@make $(TASK)-$@
|
echo "===== Processing [$@] chart ====="; \
|
||||||
|
make $(TASK)-$@; \
|
||||||
|
fi
|
||||||
|
|
||||||
init-%:
|
init-%:
|
||||||
if [ -f $*/Makefile ]; then make -C $*; fi
|
if [ -f $*/Makefile ]; then make -C $*; fi
|
||||||
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
|
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
|
||||||
|
|
||||||
lint-%: init-%
|
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 $*; fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo "Removed .b64, _partials.tpl, and _globals.tpl files"
|
@echo "Clean all build artifacts"
|
||||||
rm -f */templates/_partials.tpl
|
rm -f */templates/_partials.tpl */templates/_globals.tpl
|
||||||
rm -f */templates/_globals.tpl
|
rm -f *tgz */charts/*tgz */requirements.lock
|
||||||
rm -f *tgz */charts/*tgz
|
rm -rf */charts */tmpcharts
|
||||||
rm -f */requirements.lock
|
|
||||||
-rm -rf */charts */tmpcharts
|
|
||||||
|
|
||||||
pull-all-images:
|
pull-all-images:
|
||||||
@./tools/pull-images.sh
|
@./tools/pull-images.sh
|
||||||
|
Reference in New Issue
Block a user