-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
96 lines (84 loc) · 2.87 KB
/
Taskfile.yaml
File metadata and controls
96 lines (84 loc) · 2.87 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: 3
tasks:
docs:
dir: web
cmds:
- pnpm start
docs:build:
dir: web
cmds:
- pnpm install
- pnpm build
helm-validate:
desc: Validate Helm charts
cmds:
- |
NAME={{.CLI_ARGS}}
for chart in charts/*; do
chart_name=$(basename "$chart")
if [ -n "$NAME" ] && [ "$chart_name" != "$NAME" ]; then
continue
fi
(
cd "$chart" || exit 1
echo "Validating $chart_name..."
# Try to update dependencies if Chart.lock exists
if [ -f "Chart.lock" ]; then
if ! helm dependency update . 2>/dev/null; then
echo "⏭️ Skipping $chart_name (dependency update failed - possible Helm v4 bug)"
exit 0
fi
fi
helm lint . && helm template . > /dev/null && echo "✅ $chart_name validated successfully"
) || exit 1
done
helm-unittest:
desc: Run Helm unit tests (helm-unittest plugin)
cmds:
- |
NAME={{.CLI_ARGS}}
if ! helm unittest -h >/dev/null 2>&1; then
echo "❌ helm-unittest plugin is not installed."
echo "Install: helm plugin install https://github.com/helm-unittest/helm-unittest"
exit 1
fi
for chart in charts/*; do
chart_name=$(basename "$chart")
if [ -n "$NAME" ] && [ "$chart_name" != "$NAME" ]; then
continue
fi
if [ ! -d "$chart/tests" ] || [ -z "$(ls -A "$chart/tests" 2>/dev/null)" ]; then
echo "⏭️ Skipping $chart_name (no unit tests)"
continue
fi
(
cd "$chart" || exit 1
echo "Running unit tests for $chart_name..."
helm unittest .
) || exit 1
done
helm-package-index:
desc: Package Helm charts and update repository index
cmds:
- echo "Adding required Helm repositories..."
- helm repo add grafana https://grafana.github.io/helm-charts || true
- helm repo add prometheus-community https://prometheus-community.github.io/helm-charts || true
- helm repo update
- echo "Creating charts directory..."
- mkdir -p web/static/charts
- echo "Cleaning old chart packages..."
- rm -f web/static/charts/*.tgz
- |
for chart in component-chart loki-stack; do
cp charts/.helmignore "charts/$chart/.helmignore"
echo "Copied .helmignore to charts/$chart/.helmignore"
echo "Packaging $chart..."
helm dependency update "charts/$chart"
helm package "charts/$chart" -d web/static/charts/
echo "Packaged $chart to web/static/charts/"
done
- echo "Updating Helm repository index..."
- helm repo index web/static/charts --url https://rishang.github.io/helm-chart/charts
- echo "✅ Charts packaged successfully!"
- echo "📦 Files created in web/static/charts/"
- ls -lh web/static/charts/