diff options
author | 2022-08-01 17:05:42 +0200 | |
---|---|---|
committer | 2022-08-17 12:42:32 +0200 | |
commit | f247bf67727e4277764463a0fa3d7654eca7da4b (patch) | |
tree | e0132c0ecd93b2763481abf688c3d5f964857742 /kubernetes/dcaemod/Makefile | |
parent | 904b8911706aa930c12dd0ac38f0f212378ae9e9 (diff) |
[COMMON] Update Makefiles to enable parallelization
All Makefiles are updated to support SKIP_LINT option,
have a defined order of compilation (common -> components)
to support the parallel compilation of charts using:
make all -j8 (for 8 Jobs). Additionally use cm-push instead
of push to use the new K8S/Helm version
Issue-ID: OOM-3011
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: If9903c9d5bc646b5ce54075acc616e98c4b6706e
Diffstat (limited to 'kubernetes/dcaemod/Makefile')
-rw-r--r-- | kubernetes/dcaemod/Makefile | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/kubernetes/dcaemod/Makefile b/kubernetes/dcaemod/Makefile index 044e0cdd7d..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,31 +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. + +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +OUTPUT_DIR := $(ROOT_DIR)/../dist +PACKAGE_DIR := $(OUTPUT_DIR)/packages +SECRET_DIR := $(OUTPUT_DIR)/secrets + +HELM_REPO := local + +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: make-dcaemod-distributor-api make-dcaemod-genprocessor make-dcaemod-designtool make-dcaemod-onboarding-api make-dcaemod-runtime-api make-dcaemod-nifi-registry make-dcaemod-healthcheck +HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.)))) -make-dcaemod-distributor-api: - cd components && $(HELM_BIN) dep up dcaemod-genprocessor && $(HELM_BIN) lint dcaemod-genprocessor +.PHONY: $(EXCLUDES) $(HELM_CHARTS) -make-dcaemod-genprocessor: - cd components && $(HELM_BIN) dep up dcaemod-distributor-api && $(HELM_BIN) lint dcaemod-distributor-api +all: $(HELM_CHARTS) -make-dcaemod-designtool: - cd components && $(HELM_BIN) dep up dcaemod-designtool && $(HELM_BIN) lint dcaemod-designtool +$(HELM_CHARTS): + @echo "\n[$@]" + @make package-$@ -make-dcaemod-onboarding-api: - cd components && $(HELM_BIN) dep up dcaemod-onboarding-api && $(HELM_BIN) lint dcaemod-onboarding-api +make-%: + @if [ -f $*/Makefile ]; then make -C $*; fi -make-dcaemod-runtime-api: - cd components && $(HELM_BIN) dep up dcaemod-runtime-api && $(HELM_BIN) lint dcaemod-runtime-api +dep-%: make-% + @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) dep up $*; fi -make-dcaemod-nifi-registry: - cd components && $(HELM_BIN) dep up dcaemod-nifi-registry && $(HELM_BIN) lint dcaemod-nifi-registry +lint-%: dep-% + @if [ -f $*/Chart.yaml ]; then $(HELM_LINT_CMD) $*; fi -make-dcaemod-healthcheck: - cd components && $(HELM_BIN) dep up dcaemod-healthcheck && $(HELM_BIN) lint dcaemod-healthcheck +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) +%: + @: |