blob: 629bb34227cd1f1b41af6afa04255be3cbc3c369 [file] [log] [blame]
Zack Williamsac984412018-04-04 15:39:45 -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 -u -o pipefail
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