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