blob: 9cbf90fba7019261332a3fda0ebe23af663bef91 [file] [log] [blame]
Mike Elliottae51de82018-02-16 10:48:59 -05001PARENT_CHART := onap
2COMMON_CHARTS_DIR := common
Mike Elliott13fed112018-02-28 08:33:33 -05003SETUP_CHARTS_DIR := setup
4#Order is important
5SHARED_CHARTS := common setup mysql dgbuilder
Mike Elliottae51de82018-02-16 10:48:59 -05006# FIXME OOM-765
7ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
8OUTPUT_DIR := $(ROOT_DIR)/dist
9PACKAGE_DIR := $(OUTPUT_DIR)/packages
10SECRET_DIR := $(OUTPUT_DIR)/secrets
11
Mike Elliott2670b0e2018-03-21 12:18:40 -040012EXCLUDES := $(COMMON_CHARTS_DIR) config oneclick readiness test dist helm $(PARENT_CHART) dcae
Mike Elliott13fed112018-02-28 08:33:33 -050013EXCLUDES := $(SHARED_CHARTS) config oneclick readiness test dist $(PARENT_CHART) dcae
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000014HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART)
Mike Elliottae51de82018-02-16 10:48:59 -050015
16.PHONY: $(EXCLUDES) $(HELM_CHARTS)
17
Mike Elliott2670b0e2018-03-21 12:18:40 -040018all: $(COMMON_CHARTS_DIR) $(HELM_CHARTS)
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000019
20common:
Mike Elliott13fed112018-02-28 08:33:33 -050021all: $(SHARED_CHARTS) $(HELM_CHARTS)
22
23$(SHARED_CHARTS):
Mandeep Khindaa57d8dd2018-03-09 14:29:37 +000024 @echo "\n[$@]"
25 @make package-$@
26
Mike Elliottae51de82018-02-16 10:48:59 -050027$(HELM_CHARTS):
28 @echo "\n[$@]"
29 @make package-$@
30
31make-%:
32 @if [ -f $*/Makefile ]; then make -C $*; fi
33
34dep-%: make-%
35 @if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
36
37lint-%: dep-%
38 @if [ -f $*/Chart.yaml ]; then helm lint $*; fi
39
40package-%: lint-%
41 @mkdir -p $(PACKAGE_DIR)
42 @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi
43
44clean:
45 @rm -f */requirements.lock
46 @rm -f *tgz */charts/*tgz
47 @rm -rf $(PACKAGE_DIR)
48%:
Mike Elliott13fed112018-02-28 08:33:33 -050049 @: