Skip to content

Commit

Permalink
Ensure release chart doesn't have pre-release dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Nov 8, 2023
1 parent f2f084c commit 9a65503
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ repos:
args:
- --exclude-charts=alfresco-common,alfresco-sync-service
- --values-dir=ci
- repo: local
hooks:
- id: custom-check-chart-versions
name: Check Chart dependencies
entry: ./scripts/charts.sh
language: script
16 changes: 16 additions & 0 deletions scripts/charts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -e

for chart_file in charts/*/Chart.yaml; do
chart_version=$(yq eval '.version' "$chart_file") # Assuming you have yq installed
if [[ "$chart_version" == *-* ]]; then
continue
fi

dependencies=$(yq eval '.dependencies[] | select(.version | test("-"))' "$chart_file")
if [ -n "$dependencies" ]; then
echo "Chart $chart_file has dependencies with a pre-release version, but the main chart version doesn't."
exit 1
fi
done

echo "All charts passed the check."

0 comments on commit 9a65503

Please sign in to comment.