blob: fcecb6f5f74ac4dfdf34d5591071d0ee9a1ed95d [file] [log] [blame]
Joey Armstrongc02931b2022-11-17 16:13:20 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong34d4ad72023-01-03 09:47:15 -05003# Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandolo7414cff2021-07-23 08:48:54 -07004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Joey Armstrongc02931b2022-11-17 16:13:20 -050016# -----------------------------------------------------------------------
Matteo Scandolo7414cff2021-07-23 08:48:54 -070017
Joey Armstrongc02931b2022-11-17 16:13:20 -050018.DEFAULT_GOAL := help
Matteo Scandolo7414cff2021-07-23 08:48:54 -070019
Joey Armstrongc02931b2022-11-17 16:13:20 -050020##-------------------##
21##---] GLOBALS [---##
22##-------------------##
23dot ?= .
24TOP ?= $(dot)
25MAKEDIR ?= $(TOP)/makefiles
26
27##--------------------##
28##---] INCLUDES [---##
29##--------------------##
30include $(MAKEDIR)/include.mk
31
32branch=`cat .gitreview | grep branch | cut -d '=' -f2`
33
Joey Armstrong03588972022-12-07 17:30:09 -050034## -----------------------------------------------------------------------
35## -----------------------------------------------------------------------
Joey Armstrongc02931b2022-11-17 16:13:20 -050036help:: # @HELP Print the command options
37 @echo " test Sanity check chart versions"
38 @echo
39 @echo "[CHECK: release]"
Joey Armstrong03588972022-12-07 17:30:09 -050040 @echo " helm-repo-tools Helper tools"
Joey Armstrongc02931b2022-11-17 16:13:20 -050041 @echo " tagcollisionreject.sh 404 - raw.github source MIA"
Matteo Scandolo7414cff2021-07-23 08:48:54 -070042 @echo
43 @echo "\033[0;31m VOLTHA HELM CHARTS \033[0m"
44 @echo
45 @grep -E '^.*: .* *# *@HELP' $(MAKEFILE_LIST) \
46 | sort \
47 | awk ' \
48 BEGIN {FS = ": .* *# *@HELP"}; \
49 {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \
50 '
51
Joey Armstrongc02931b2022-11-17 16:13:20 -050052# -----------------------------------------------------------------------
53# curl: 404: Not Found
54# https://raw.githubusercontent.com
55# -----------------------------------------------------------------------
56# github no longer supports usercontent retrieval, svc was used as a CDN.
57# 3 distinct versions of tcr.sh are used by jenkins jobs.
58# -----------------------------------------------------------------------
59# Short term answer:
60# o Find something usable for interactive use.
61# Long term answer:
62# o Refactor tcr.sh x [n] and support consistent functionality with a single script.
63# -----------------------------------------------------------------------
Matteo Scandolo7414cff2021-07-23 08:48:54 -070064tagcollisionreject.sh:
65 @curl -o tagcollisionreject.tmp.sh https://raw.githubusercontent.com/opencord/ci-management/master/jjb/shell/tagcollisionreject.sh
66 @echo 6dc8352d47f415e003dbddc30ede194ca304907d25f1c2a384f928083194860f tagcollisionreject.tmp.sh | sha256sum --check
67 @mv tagcollisionreject.tmp.sh tagcollisionreject.sh
68
69test-tags: tagcollisionreject.sh
70 @bash ./tagcollisionreject.sh
71
Joey Armstrong03588972022-12-07 17:30:09 -050072## -----------------------------------------------------------------------
73## [NOTE] moving to makefiles/lint/helm/include.mk
74## -----------------------------------------------------------------------
Matteo Scandolo7414cff2021-07-23 08:48:54 -070075helm-repo-tools:
76 git clone "https://gerrit.opencord.org/helm-repo-tools"
77
Joey Armstrong34d4ad72023-01-03 09:47:15 -050078lint-local: lint-helm lint-chart
79
80lint-helm:
81 helm-repo-tools/helmlint.sh
82
83lint-chart:
84 helm-repo-tools/chart_version_check.sh
85# helm-repo-tools/lchart_version_check.sh
86
Joey Armstrong03588972022-12-07 17:30:09 -050087## -----------------------------------------------------------------------
88## -----------------------------------------------------------------------
89# test-all += test-tags # tagcollisionreject + curl is broken
90test-all += helm-repo-tools
91test: $(test-all) # @HELP Makes sure the versions used in the charts are valid
Matteo Scandolo7414cff2021-07-23 08:48:54 -070092 @COMPARISON_BRANCH=origin/$(branch) ./helm-repo-tools/chart_version_check.sh
93
Joey Armstrong03588972022-12-07 17:30:09 -050094## -----------------------------------------------------------------------
95## -----------------------------------------------------------------------
Joey Armstrongae55f952022-11-29 16:20:27 -050096clean :: # @HELP Removes all files downloaded to run the tests
Joey Armstrongebc25f82022-11-04 15:10:51 -040097 $(RM) -r helm-repo-tools
98 $(RM) tagcollisionreject.*
Joey Armstrongc02931b2022-11-17 16:13:20 -050099
100# [EOF]