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