-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathgen-docs.sh
executable file
·49 lines (43 loc) · 1.26 KB
/
gen-docs.sh
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
#!/bin/bash
function show_help {
echo "Usage: $(basename "$0") [-c CHART_NAME]"
echo ""
echo "Options:"
echo " -c CHART_NAME Specify the name of the chart to generate docs for."
echo " -h Show this help message."
echo ""
echo "If CHART_NAME is not provided, the script will generate docs for all charts in the 'charts' directory."
}
CHART_NAME=""
while getopts "c:h" opt; do
case $opt in
c)
CHART_NAME=$OPTARG
;;
h)
show_help
exit 0
;;
*)
show_help
exit 1
;;
esac
done
if [[ -n "$CHART_NAME" ]]; then
if [[ -d "charts/$CHART_NAME" ]]; then
echo "Generating helm docs for chart: $CHART_NAME"
docker run --rm -v "./charts/$CHART_NAME":/src -w /src jnorwood/helm-docs:v1.11.0
else
echo "Error: Chart '$CHART_NAME' does not exist in the 'charts' directory."
exit 1
fi
exit 0
fi
echo "Generating helm docs for all charts in the 'charts' directory."
for chart in charts/*; do
if [[ -d "$chart" ]]; then
echo "Generating helm docs for chart: $(basename "$chart")"
docker run --rm -v "./$chart":/src -w /src jnorwood/helm-docs:v1.11.0
fi
done