blob: 4cf97059ac81bfd50dc5c7b2d1f29345cf543de2 [file] [log] [blame]
Mike Elliottae51de82018-02-16 10:48:59 -05001PARENT_CHART := onap
2COMMON_CHARTS_DIR := common
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +00003SETUP_CHARTS_DIR := setup
Mike Elliottae51de82018-02-16 10:48:59 -05004# FIXME OOM-765
5ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
6OUTPUT_DIR := $(ROOT_DIR)/dist
7PACKAGE_DIR := $(OUTPUT_DIR)/packages
8SECRET_DIR := $(OUTPUT_DIR)/secrets
9
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000010EXCLUDES := $(SETUP_CHARTS_DIR) $(COMMON_CHARTS_DIR) config oneclick readiness test dist $(PARENT_CHART) dcae
11HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART)
Mike Elliottae51de82018-02-16 10:48:59 -050012
13.PHONY: $(EXCLUDES) $(HELM_CHARTS)
14
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000015all: $(COMMON_CHARTS_DIR) $(SETUP_CHARTS_DIR) $(HELM_CHARTS)
16
17common:
18 @echo "\n[$@]"
19 @make package-$@
20
21setup:
22 @echo "\n[$@]"
23 @make package-$@
Mike Elliottae51de82018-02-16 10:48:59 -050024
25$(HELM_CHARTS):
26 @echo "\n[$@]"
27 @make package-$@
28
29make-%:
30 @if [ -f $*/Makefile ]; then make -C $*; fi
31
32dep-%: make-%
33 @if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
34
35lint-%: dep-%
36 @if [ -f $*/Chart.yaml ]; then helm lint $*; fi
37
38package-%: lint-%
39 @mkdir -p $(PACKAGE_DIR)
40 @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi
41
42clean:
43 @rm -f */requirements.lock
44 @rm -f *tgz */charts/*tgz
45 @rm -rf $(PACKAGE_DIR)
46%:
47 @: