forked from aws/eks-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint-charts.sh
executable file
·37 lines (33 loc) · 944 Bytes
/
lint-charts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -euo pipefail
GIT_REPO_ROOT=$(git rev-parse --show-toplevel)
BUILD_DIR="${GIT_REPO_ROOT}/build"
TOOLS_DIR="${BUILD_DIR}/tools"
STABLE="${GIT_REPO_ROOT}/stable"
export PATH="${TOOLS_DIR}:${PATH}"
FAILED_V2=()
FAILED_V3=()
cd ${STABLE}
for d in */; do
EXTRA_ARGS=""
if [ -f ${STABLE}/${d}/ci/extra_args ]; then
EXTRA_ARGS=$(cat ${STABLE}/${d}/ci/extra_args)
fi
echo "Linting chart ${d} w/ helm v3"
helmv3 lint ${STABLE}/${d} || FAILED_V3+=("${d}")
echo "Linting chart ${d} w/ helm v2"
helmv2 lint ${STABLE}/${d} || FAILED_V2+=("${d}")
done
if [[ "${#FAILED_V2[@]}" -eq 0 ]] && [[ "${#FAILED_V3[@]}" -eq 0 ]]; then
echo "All charts passed linting!"
exit 0
else
echo "Helm v2:"
for chart in "${FAILED_V2[@]}"; do
printf "%40s ❌\n" "$chart"
done
echo "Helm v3:"
for chart in "${FAILED_V2[@]}"; do
printf "%40s ❌\n" "$chart"
done
fi