mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-22 03:25:53 +10:00
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if git diff --name-only --cached | grep '/kubeapps/'; then
|
||||
printf '\n\U1F6AB Commit cancelled\n\nKubeapps changes detected in this repository.\nPlease, implement them in the kubeapps repository (https://github.com/kubeapps/kubeapps/tree/master/chart/kubeapps).\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if git diff --name-only --cached | grep '/upstreamed/'; then
|
||||
printf '\n\U1F6AB Commit cancelled\n\nChanges detected in the "upstreamed" folder.\nPlease, implement them in the Helm Charts repository (https://github.com/helm/charts).\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
currentBranch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
originCommit="$(git rev-parse --short "$(git merge-base master "$currentBranch")")"
|
||||
filesToBePushed="$(git diff --name-only "$originCommit")"
|
||||
failed=0
|
||||
|
||||
for chartName in $( cut -d'/' -f1,2 <<< "$filesToBePushed" | uniq ); do
|
||||
# Avoid running 'helm lint|install' when modified dirs are not charts
|
||||
if [[ $chartName = bitnami/* ]]; then
|
||||
printf '\033[01;33mValidating %s:\n\033[0m' "$chartName"
|
||||
chartPath="$(git rev-parse --show-toplevel)"/"$chartName"
|
||||
|
||||
printf '\033[0;34m- Running helm lint %s\n\033[0m' "$chartPath"
|
||||
if helm lint "$chartPath"; then
|
||||
printf '\033[0;32m\U2705 helm lint %s\n\n\033[0m' "$chartPath"
|
||||
else
|
||||
printf '\033[0;31m\U1F6AB helm lint %s failed. Push cancelled.\n\n\033[0m' "$chartPath"
|
||||
failed=1
|
||||
fi
|
||||
|
||||
printf '\033\033[0;34m- Running helm install --dry-run %s\n\033[0m' "$chartPath"
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami >> /dev/null
|
||||
helm dependency update "$chartPath" >> /dev/null
|
||||
if helm install --dry-run "$chartPath"; then
|
||||
printf '\033[0;32m\U2705 helm install --dry-run %s\n\n\033[0m' "$chartPath"
|
||||
else
|
||||
printf '\033[0;31m\U1F6AB helm install --dry-run %s failed. Push cancelled.\n\n\033[0m' "$chartPath"
|
||||
failed=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
exit $failed
|
||||
Reference in New Issue
Block a user