aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/Makefile
diff options
context:
space:
mode:
authorMike Elliott <mike.elliott@amdocs.com>2018-02-16 10:48:59 -0500
committerAlexis de Talhouƫt <alexis.de_talhouet@bell.ca>2018-02-23 20:35:00 +0000
commitae51de89e201b39aee5ef5d414b28eb946f33209 (patch)
tree4d2fc28386ad1abbb39afa72a28506aa79c46ba0 /kubernetes/Makefile
parenta70775c54d244fe769293ea3bba1d99881416e6e (diff)
Add Makefile to OOM project
Executing 'make' provides: - linting of all charts - resolution of chart/subchart dependencies - creation and deployment of Helm packages to a local Helm repo Prerequisite: Start up a local repo and register with Helm as 'local'. Example: > helm serve > helm repo add local http://127.0.0.1:8879 Change-Id: Ie08e8fc2593ac7e67b01f93e266953b962adef5d Signed-off-by: Mike Elliott <mike.elliott@amdocs.com> Issue-ID: OOM-265
Diffstat (limited to 'kubernetes/Makefile')
-rw-r--r--kubernetes/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/kubernetes/Makefile b/kubernetes/Makefile
new file mode 100644
index 0000000000..5e8350492c
--- /dev/null
+++ b/kubernetes/Makefile
@@ -0,0 +1,39 @@
+PARENT_CHART := onap
+COMMON_CHARTS_DIR := common
+
+# FIXME OOM-765
+ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+OUTPUT_DIR := $(ROOT_DIR)/dist
+PACKAGE_DIR := $(OUTPUT_DIR)/packages
+SECRET_DIR := $(OUTPUT_DIR)/secrets
+
+EXCLUDES := $(COMMON_CHARTS_DIR) config oneclick readiness test dist $(PARENT_CHART) dcae
+HELM_CHARTS := $(COMMON_CHARTS_DIR) $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART)
+
+.PHONY: $(EXCLUDES) $(HELM_CHARTS)
+
+all: $(HELM_CHARTS)
+
+$(HELM_CHARTS):
+ @echo "\n[$@]"
+ @make package-$@
+
+make-%:
+ @if [ -f $*/Makefile ]; then make -C $*; fi
+
+dep-%: make-%
+ @if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
+
+lint-%: dep-%
+ @if [ -f $*/Chart.yaml ]; then helm lint $*; fi
+
+package-%: lint-%
+ @mkdir -p $(PACKAGE_DIR)
+ @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi
+
+clean:
+ @rm -f */requirements.lock
+ @rm -f *tgz */charts/*tgz
+ @rm -rf $(PACKAGE_DIR)
+%:
+ @: \ No newline at end of file