Skip to content

Commit 7baa1d3

Browse files
committed
tweak chart linting script
Signed-off-by: Lance-Drane <Lance-Drane@users.noreply.github.com>
1 parent 277462f commit 7baa1d3

5 files changed

Lines changed: 68 additions & 62 deletions

File tree

.github/workflows/helm-release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ on:
66
- main
77
paths:
88
- charts/**
9-
- lint-charts.sh
109
- .github/workflows/helm-release.yml
1110
pull_request:
1211
branches:
1312
- main
1413
paths:
1514
- charts/**
16-
- lint-charts.sh
1715
- .github/workflows/helm-release.yml
1816
workflow_dispatch:
1917
inputs:
@@ -46,7 +44,7 @@ jobs:
4644
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4745

4846
- name: Lint and template charts
49-
run: ./lint-charts.sh
47+
run: ./charts/lint-charts.sh
5048

5149
helm-release:
5250
runs-on: ubuntu-latest

charts/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
charts
2+
Chart.lock
3+
*.tgz
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Example values for umbrella-chart usage where a shared secret already exists.
2+
#
3+
# This expects a Secret in the target namespace:
4+
# metadata.name: intersect-shared-secrets
5+
# data.API_KEY: <base64 encoded API key>
6+
# data.BROKER_PASSWORD: <base64 encoded broker password>
7+
# data.MINIO_PASSWORD: <base64 encoded minio password>
8+
9+
app:
10+
apiKey:
11+
isSecret: false
12+
hardcoded: "01020304050607080910111213141516"
13+
minio:
14+
password:
15+
isSecret: false
16+
hardcoded: "01020304050607080910111213141516"
17+
18+
broker:
19+
password:
20+
isSecret: false
21+
hardcoded: "01020304050607080910111213141516"
22+
23+
campaignRepository:
24+
backend: memory

charts/lint-charts.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
cd "$(dirname "$0")"
6+
7+
rc=0
8+
9+
for chart_yaml in */Chart.yaml; do
10+
chart_dir="$(dirname "$chart_yaml")"
11+
echo "======= VERIFYING CHART: $chart_dir ======="
12+
13+
# Ensure local chart dependencies are present if any are declared.
14+
helm dependency update "$chart_dir" || {
15+
rc=1
16+
echo "--------- DEPENDENCY BUILD FAILED: $chart_dir --------"
17+
}
18+
19+
for values_file in "$chart_dir"/examples/*.yaml; do
20+
echo "------- VERIFYING EXAMPLE: $values_file --------"
21+
22+
helm template "$chart_dir" -f "$values_file" >/dev/null || {
23+
rc=1
24+
echo "--------- TEMPLATE VERIFICATION FAILED: $values_file --------"
25+
}
26+
27+
helm lint "$chart_dir" -f "$values_file" || {
28+
rc=1
29+
echo "--------- LINT VERIFICATION FAILED: $values_file --------"
30+
}
31+
32+
echo "------- FINISHED VERIFYING EXAMPLE: $values_file --------"
33+
echo
34+
done
35+
36+
echo "======= FINISHED CHART: $chart_dir ======="
37+
echo
38+
done
39+
40+
exit "$rc"

lint-charts.sh

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)