Mike Elliott | ae51de8 | 2018-02-16 10:48:59 -0500 | [diff] [blame] | 1 | PARENT_CHART := onap |
| 2 | COMMON_CHARTS_DIR := common |
Mandeep Khinda | a57d8dd | 2018-03-09 14:29:37 +0000 | [diff] [blame] | 3 | SETUP_CHARTS_DIR := setup |
Mike Elliott | ae51de8 | 2018-02-16 10:48:59 -0500 | [diff] [blame] | 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 | |
Mandeep Khinda | a57d8dd | 2018-03-09 14:29:37 +0000 | [diff] [blame] | 10 | EXCLUDES := $(SETUP_CHARTS_DIR) $(COMMON_CHARTS_DIR) config oneclick readiness test dist $(PARENT_CHART) dcae |
| 11 | HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART) |
Mike Elliott | ae51de8 | 2018-02-16 10:48:59 -0500 | [diff] [blame] | 12 | |
| 13 | .PHONY: $(EXCLUDES) $(HELM_CHARTS) |
| 14 | |
Mandeep Khinda | a57d8dd | 2018-03-09 14:29:37 +0000 | [diff] [blame] | 15 | all: $(COMMON_CHARTS_DIR) $(SETUP_CHARTS_DIR) $(HELM_CHARTS) |
| 16 | |
| 17 | common: |
| 18 | @echo "\n[$@]" |
| 19 | @make package-$@ |
| 20 | |
| 21 | setup: |
| 22 | @echo "\n[$@]" |
| 23 | @make package-$@ |
Mike Elliott | ae51de8 | 2018-02-16 10:48:59 -0500 | [diff] [blame] | 24 | |
| 25 | $(HELM_CHARTS): |
| 26 | @echo "\n[$@]" |
| 27 | @make package-$@ |
| 28 | |
| 29 | make-%: |
| 30 | @if [ -f $*/Makefile ]; then make -C $*; fi |
| 31 | |
| 32 | dep-%: make-% |
| 33 | @if [ -f $*/requirements.yaml ]; then helm dep up $*; fi |
| 34 | |
| 35 | lint-%: dep-% |
| 36 | @if [ -f $*/Chart.yaml ]; then helm lint $*; fi |
| 37 | |
| 38 | package-%: lint-% |
| 39 | @mkdir -p $(PACKAGE_DIR) |
| 40 | @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi |
| 41 | |
| 42 | clean: |
| 43 | @rm -f */requirements.lock |
| 44 | @rm -f *tgz */charts/*tgz |
| 45 | @rm -rf $(PACKAGE_DIR) |
| 46 | %: |
| 47 | @: |