X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fdcaemod%2FMakefile;h=5617b0d8166bf5e6d39a9376ff609e52747f67ef;hb=f247bf67727e4277764463a0fa3d7654eca7da4b;hp=b1e5a7355e9cde3fbda45287e2b4065f19bba847;hpb=f992a85bb2966dc92cae976a777644ccf12f5c61;p=oom.git diff --git a/kubernetes/dcaemod/Makefile b/kubernetes/dcaemod/Makefile index b1e5a7355e..5617b0d816 100644 --- a/kubernetes/dcaemod/Makefile +++ b/kubernetes/dcaemod/Makefile @@ -1,4 +1,5 @@ -# Copyright © 2020 AT&T Intellectual Property. All rights reserved. +# Copyright © 2020 Samsung Electronics +# Copyright (c) 2021 AT&T. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,26 +12,50 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -make-dcaemod: make-dcaemod-distributor-api make-dcaemod-genprocessor make-dcaemod-designtool make-dcaemod-onboarding-api make-dcaemod-runtime-api make-dcaemod-nifi-registry -make-dcaemod-distributor-api: - cd components && helm dep up dcaemod-genprocessor && helm lint dcaemod-genprocessor +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +OUTPUT_DIR := $(ROOT_DIR)/../dist +PACKAGE_DIR := $(OUTPUT_DIR)/packages +SECRET_DIR := $(OUTPUT_DIR)/secrets -make-dcaemod-genprocessor: - cd components && helm dep up dcaemod-distributor-api && helm lint dcaemod-distributor-api +HELM_REPO := local -make-dcaemod-designtool: - cd components && helm dep up dcaemod-designtool && helm lint dcaemod-designtool +EXCLUDES := +HELM_BIN := helm +ifneq ($(SKIP_LINT),TRUE) + HELM_LINT_CMD := $(HELM_BIN) lint +else + HELM_LINT_CMD := echo "Skipping linting of" +endif -make-dcaemod-onboarding-api: - cd components && helm dep up dcaemod-onboarding-api && helm lint dcaemod-onboarding-api +HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.)))) -make-dcaemod-runtime-api: - cd components && helm dep up dcaemod-runtime-api && helm lint dcaemod-runtime-api +.PHONY: $(EXCLUDES) $(HELM_CHARTS) -make-dcaemod-nifi-registry: - cd components && helm dep up dcaemod-nifi-registry && helm lint dcaemod-nifi-registry +all: $(HELM_CHARTS) + +$(HELM_CHARTS): + @echo "\n[$@]" + @make package-$@ + +make-%: + @if [ -f $*/Makefile ]; then make -C $*; fi + +dep-%: make-% + @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) dep up $*; fi + +lint-%: dep-% + @if [ -f $*/Chart.yaml ]; then $(HELM_LINT_CMD) $*; fi + +package-%: lint-% + @mkdir -p $(PACKAGE_DIR) + @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) cm-push -f $$PACKAGE_NAME local; fi + @sleep 3 + #@$(HELM_BIN) repo index $(PACKAGE_DIR) clean: - @find . -type f -name '*.tgz' -delete - @find . -type f -name '*.lock' -delete + @rm -f */Chart.lock + @rm -f *tgz */charts/*tgz + @rm -rf $(PACKAGE_DIR) +%: + @: