Joey Armstrong | ae55f95 | 2022-11-29 16:20:27 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
| 3 | # Copyright 2022 Open Networking Foundation (ONF) and the ONF Contributors |
| 4 | # |
| 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. |
| 16 | # ----------------------------------------------------------------------- |
| 17 | |
| 18 | ##-------------------## |
| 19 | ##---] GLOBALS [---## |
| 20 | ##-------------------## |
| 21 | env-clean = /usr/bin/env --ignore-environment |
| 22 | xargs-n1 := xargs -0 -t -n1 --no-run-if-empty |
| 23 | |
| 24 | helmlint-sh := $(TOP)/helm-repo-tools/helmlint.sh |
| 25 | chartcheck-sh := $(TOP)/helm-repo-tools/chart_version_check.sh |
| 26 | |
| 27 | ##-------------------## |
| 28 | ##---] TARGETS [---## |
| 29 | ##-------------------## |
| 30 | .PHONY: lint-helm |
| 31 | .PHONY: lint-chart |
| 32 | |
| 33 | ifdef UNSTABLE |
| 34 | # Repair failures before enabling as a default. |
| 35 | lint : lint-helm |
| 36 | lint : lint-chart |
| 37 | endif |
| 38 | |
| 39 | ## ----------------------------------------------------------------------- |
| 40 | ## ----------------------------------------------------------------------- |
| 41 | lint-helm: $(helmlint-sh) |
| 42 | $(helmlint-sh) |
| 43 | |
| 44 | ## ----------------------------------------------------------------------- |
| 45 | ## ----------------------------------------------------------------------- |
| 46 | lint-chart: $(chartcheck-sh) |
| 47 | $(chartcheck-sh) |
| 48 | |
| 49 | ## ----------------------------------------------------------------------- |
| 50 | ## ----------------------------------------------------------------------- |
| 51 | $(helmlint-sh) $(chartcheck-sh): |
| 52 | git clone "https://gerrit.opencord.org/helm-repo-tools" |
| 53 | |
| 54 | ## ----------------------------------------------------------------------- |
| 55 | ## ----------------------------------------------------------------------- |
| 56 | help:: |
| 57 | @echo " lint-chart chart_version_check.sh" |
| 58 | @echo " lint-helm Syntax check helm configs" |
| 59 | |
| 60 | ## ----------------------------------------------------------------------- |
| 61 | ## ----------------------------------------------------------------------- |
| 62 | clean:: |
| 63 | $(RM) -r $(TOP)/helm-repo-tools |
| 64 | |
| 65 | # [EOF] |