mirror of
https://github.com/bitnami/charts.git
synced 2026-03-14 14:57:22 +08:00
28 lines
836 B
Bash
Executable File
28 lines
836 B
Bash
Executable File
#!/bin/bash
|
|
|
|
. ../functions/libkubeval.sh
|
|
|
|
readonly current_branch="$(git rev-parse --abbrev-ref HEAD)"
|
|
readonly origin_commit="$(git rev-parse --short "$(git merge-base master "$current_branch")")"
|
|
readonly files_to_push="$(git diff --name-only "$origin_commit")"
|
|
failed=0
|
|
|
|
for chart_name in $( cut -d'/' -f1,2 <<< "$files_to_push" | uniq ); do
|
|
check_yaml_lint
|
|
# Avoid running 'yamllint' when modified dirs are not charts
|
|
if [[ $chart_name = bitnami/* ]]; then
|
|
printf '\033[01;33mLinting yaml of %s:\n\033[0m' "$chart_name"
|
|
if ! run_yaml_lint_chart "$chart_name"; then
|
|
failed=1
|
|
fi
|
|
fi
|
|
done
|
|
|
|
if [[ "$failed" = "1" ]]; then
|
|
printf '\033[0;31m\U0001F6AB YAML lint failed. Not pushing\n\n\033[0m'
|
|
else
|
|
printf '\033[0;32m\U00002705 YAML lint succeeded\n\n\033[0m'
|
|
fi
|
|
|
|
exit $failed
|