VOL-4846 - Added targets lint-chart & lint-helm
README.md
Makefile
makefiles/lint/helm.mk
makefiles/lint/include.mk
=========================
* In the quest to stop having jenkins failing jobs post checkin for
content problems added targets lint-chart & lint-helm which invoke
commands mentioned in README.md.
* Logic is currently conditional: make lint-helm UNSTABLE=1, failures
will need to be cleaned up before the command can be run as a default.
Change-Id: I6b445a6600c283b8068201a006792aeacf5407aa
diff --git a/Makefile b/Makefile
index 237898b..1a86238 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,8 @@
branch=`cat .gitreview | grep branch | cut -d '=' -f2`
help:: # @HELP Print the command options
+ @echo
+ @echo "[TEST]"
@echo " test Sanity check chart versions"
@echo
@echo "[CHECK: release]"
@@ -73,7 +75,7 @@
test: test-tags helm-repo-tools # @HELP Makes sure the versions used in the charts are valid
@COMPARISON_BRANCH=origin/$(branch) ./helm-repo-tools/chart_version_check.sh
-clean: # @HELP Removes all files downloaded to run the tests
+clean :: # @HELP Removes all files downloaded to run the tests
$(RM) -r helm-repo-tools
$(RM) tagcollisionreject.*
diff --git a/README.md b/README.md
index b850cdc..00f3524 100644
--- a/README.md
+++ b/README.md
@@ -617,5 +617,5 @@
The two scripts that should be run to test are:
-- `helmlint.sh`
-- `chart_version_check.sh`
+- `helmlint.sh` (make lint-helm)
+- `chart_version_check.sh` (make lint-chart)
diff --git a/VERSION b/VERSION
old mode 100755
new mode 100644
index 8ee49b2..fc33f09
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.2.1-dev
+3.2.1-dev1
diff --git a/makefiles/include.mk b/makefiles/include.mk
index aa8c402..e734aeb 100644
--- a/makefiles/include.mk
+++ b/makefiles/include.mk
@@ -24,9 +24,9 @@
## -----------------------------------------------------------------------
help::
@echo "USAGE: $(MAKE) [options] [target] ..."
- # @echo " test Sanity check chart versions"
include $(MAKEDIR)/consts.mk
include $(MAKEDIR)/lint/include.mk
+include $(MAKEDIR)/variables.mk
# [EOF]
diff --git a/makefiles/lint/helm.mk b/makefiles/lint/helm.mk
new file mode 100644
index 0000000..923e746
--- /dev/null
+++ b/makefiles/lint/helm.mk
@@ -0,0 +1,65 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+env-clean = /usr/bin/env --ignore-environment
+xargs-n1 := xargs -0 -t -n1 --no-run-if-empty
+
+helmlint-sh := $(TOP)/helm-repo-tools/helmlint.sh
+chartcheck-sh := $(TOP)/helm-repo-tools/chart_version_check.sh
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+.PHONY: lint-helm
+.PHONY: lint-chart
+
+ifdef UNSTABLE
+ # Repair failures before enabling as a default.
+ lint : lint-helm
+ lint : lint-chart
+endif
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-helm: $(helmlint-sh)
+ $(helmlint-sh)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-chart: $(chartcheck-sh)
+ $(chartcheck-sh)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+$(helmlint-sh) $(chartcheck-sh):
+ git clone "https://gerrit.opencord.org/helm-repo-tools"
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help::
+ @echo " lint-chart chart_version_check.sh"
+ @echo " lint-helm Syntax check helm configs"
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+clean::
+ $(RM) -r $(TOP)/helm-repo-tools
+
+# [EOF]
diff --git a/makefiles/lint/include.mk b/makefiles/lint/include.mk
index 38a7a50..f904217 100644
--- a/makefiles/lint/include.mk
+++ b/makefiles/lint/include.mk
@@ -1,8 +1,26 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
# Copyright 2022 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
# -----------------------------------------------------------------------
+help::
+ @echo
+ @echo "[LINT]"
+
+include $(MAKEDIR)/lint/helm.mk
+
ifdef YAML_FILES
include $(MAKEDIR)/lint/yaml/python.mk
else
diff --git a/makefiles/variables.mk b/makefiles/variables.mk
new file mode 100644
index 0000000..72d449b
--- /dev/null
+++ b/makefiles/variables.mk
@@ -0,0 +1,26 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+help ::
+ @echo
+ @echo "[VARIABLES]"
+ @echo " UNSTABLE= Build targets prone to failure (lint-helm)"
+
+# [EOF]