Update Makefile

This patchset updates the Makefile to process all subfolders except an
explicitly specified EXCLUDES-list.  This would avoid developers adding
new charts from needing to modify the Makefile, except for needing it
be excluded.  Also, this would eases the process of later migrating and
integrating charts across OSH, OSH-infra, OSH-addons, etc.

Change-Id: I6efde39b678c7d73fb4a29d3d8d7793f3e4d8e95
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2017-07-08 12:50:35 -05:00
parent e0fa1372a6
commit 41dc82ed7f
1 changed files with 15 additions and 8 deletions

View File

@ -12,26 +12,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
HELM = helm
TASK = build
HELM := helm
TASK := build
CHARTS = elasticsearch helm-toolkit postgresql
EXCLUDES := helm-toolkit doc tests tools logs
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
all: $(CHARTS)
$(CHARTS):
@echo
@echo "===== Processing [$@] chart ====="
@make $(TASK)-$@
init-%:
@echo
@echo "===== Initializing $*"
if [ -f $*/Makefile ]; then make -C $*; fi
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
lint-%: init-%
$(HELM) lint $*
if [ -d $* ]; then $(HELM) lint $*; fi
build-%: lint-%
$(HELM) package $*
if [ -d $* ]; then $(HELM) package $*; fi
.PHONY: $(CHARTS)
clean:
@echo "Removed .b64, _partials.tpl, and _globals.tpl files"
rm -rf helm-toolkit/secrets/*.b64
rm -rf */templates/_partials.tpl
rm -rf */templates/_globals.tpl
.PHONY: $(EXCLUDES) $(CHARTS)