blob: 50462575605c2b4b354f23d39d234fe5588617c5 [file] [log] [blame]
Zack Williams9963fe52018-04-03 08:40:26 -07001#/usr/bin/env bash
2
3# Copyright 2018-present Open Networking Foundation
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# helmlint.sh
18# run `helm lint` on all helm charts that are found
19
20set +e
21echo "helmlint.sh, using helm version: $(helm version -c --short)"
22
23fail_lint=0
24
25for chart in $(find . -name Chart.yaml -print) ; do
26
27 chartdir=$(dirname "${chart}")
28
29 # lint with values.yaml if it exists
30 if [ -f "${chartdir}/values.yaml" ]; then
31 helm lint --strict --values "${chartdir}/values.yaml" "${chartdir}"
32 else
33 helm lint --strict "${chartdir}"
34 fi
35
36 rc=$?
37 if [[ $rc != 0 ]]; then
38 fail_lint=1
39 fi
40done
41
42if [[ $fail_lint != 0 ]]; then
43 exit 1
44fi
45
46exit 0