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:
Tin Lam 2018-05-14 00:15:06 -05:00
parent 966a7f08ef
commit 768ea46d21

View File

@ -14,39 +14,37 @@
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash
HELM := helm
TASK := build
EXCLUDES := doc tests tools logs tmp
CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
EXCLUDES := helm-toolkit doc tests tools logs tmp
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
.PHONY: $(EXCLUDES) $(CHARTS)
all: $(CHARTS)
$(CHARTS):
@echo
@echo "===== Processing [$@] chart ====="
@make $(TASK)-$@
@if [ -d $@ ]; then \
echo; \
echo "===== Processing [$@] chart ====="; \
make $(TASK)-$@; \
fi
init-%:
if [ -f $*/Makefile ]; then make -C $*; fi
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
lint-%: init-%
if [ -d $* ]; then $(HELM) lint $*; fi
if [ -d $* ]; then helm lint $*; fi
build-%: lint-%
if [ -d $* ]; then $(HELM) package $*; fi
if [ -d $* ]; then helm package $*; fi
clean:
@echo "Removed .b64, _partials.tpl, and _globals.tpl files"
rm -f */templates/_partials.tpl
rm -f */templates/_globals.tpl
rm -f *tgz */charts/*tgz
rm -f */requirements.lock
-rm -rf */charts */tmpcharts
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
pull-all-images:
@./tools/pull-images.sh