From ae51de89e201b39aee5ef5d414b28eb946f33209 Mon Sep 17 00:00:00 2001 From: Mike Elliott Date: Fri, 16 Feb 2018 10:48:59 -0500 Subject: 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 Issue-ID: OOM-265 --- kubernetes/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ kubernetes/common/Makefile | 25 +++++++++++++++++++++++++ kubernetes/consul/Chart.yaml | 2 +- kubernetes/kube2msb/Chart.yaml | 2 +- 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 kubernetes/Makefile create mode 100644 kubernetes/common/Makefile (limited to 'kubernetes') 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 diff --git a/kubernetes/common/Makefile b/kubernetes/common/Makefile new file mode 100644 index 0000000000..1900f31a44 --- /dev/null +++ b/kubernetes/common/Makefile @@ -0,0 +1,25 @@ +EXCLUDES := test +HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) + +.PHONY: $(EXCLUDES) $(HELM_CHARTS) + +all: $(HELM_CHARTS) + +$(HELM_CHARTS): + @echo "\n[$@]" + @make lint-$@ + +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 + +clean: + @rm -f */requirements.lock + @rm -f *tgz */charts/*tgz +%: + @: \ No newline at end of file diff --git a/kubernetes/consul/Chart.yaml b/kubernetes/consul/Chart.yaml index 318234db06..2d2d7ba82c 100644 --- a/kubernetes/consul/Chart.yaml +++ b/kubernetes/consul/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 -description: A Helm chart for Consul +description: ONAP Consul Heath Monitor name: consul version: 1.1.0 diff --git a/kubernetes/kube2msb/Chart.yaml b/kubernetes/kube2msb/Chart.yaml index 97a3454337..b648adc701 100644 --- a/kubernetes/kube2msb/Chart.yaml +++ b/kubernetes/kube2msb/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: A Helm chart for Kubernetes -name: kube2msb-registrator +name: kube2msb version: 0.1.0 -- cgit 1.2.3-korg