Mike Elliott | ae51de8 | 2018-02-16 10:48:59 -0500 | [diff] [blame] | 1 | PARENT_CHART := onap |
| 2 | COMMON_CHARTS_DIR := common |
| 3 | |
| 4 | # FIXME OOM-765 |
| 5 | ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) |
| 6 | OUTPUT_DIR := $(ROOT_DIR)/dist |
| 7 | PACKAGE_DIR := $(OUTPUT_DIR)/packages |
| 8 | SECRET_DIR := $(OUTPUT_DIR)/secrets |
| 9 | |
| 10 | EXCLUDES := $(COMMON_CHARTS_DIR) config oneclick readiness test dist $(PARENT_CHART) dcae |
| 11 | HELM_CHARTS := $(COMMON_CHARTS_DIR) $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART) |
| 12 | |
| 13 | .PHONY: $(EXCLUDES) $(HELM_CHARTS) |
| 14 | |
| 15 | all: $(HELM_CHARTS) |
| 16 | |
| 17 | $(HELM_CHARTS): |
| 18 | @echo "\n[$@]" |
| 19 | @make package-$@ |
| 20 | |
| 21 | make-%: |
| 22 | @if [ -f $*/Makefile ]; then make -C $*; fi |
| 23 | |
| 24 | dep-%: make-% |
| 25 | @if [ -f $*/requirements.yaml ]; then helm dep up $*; fi |
| 26 | |
| 27 | lint-%: dep-% |
| 28 | @if [ -f $*/Chart.yaml ]; then helm lint $*; fi |
| 29 | |
| 30 | package-%: lint-% |
| 31 | @mkdir -p $(PACKAGE_DIR) |
| 32 | @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi |
| 33 | |
| 34 | clean: |
| 35 | @rm -f */requirements.lock |
| 36 | @rm -f *tgz */charts/*tgz |
| 37 | @rm -rf $(PACKAGE_DIR) |
| 38 | %: |
| 39 | @: |