Skip to content

Commit

Permalink
chore(bors): merge pull request #435
Browse files Browse the repository at this point in the history
435: fix(scripts/helm-docs): ignore dependency helm charts when generating README.md r=niladrih a=niladrih

The script `/scripts/helm/generate-readme.sh` generates documentation for all charts present inside the `/chart` directory. The `helm-docs` tool recursively walks through all charts in the directory and generates docs for them. This is inconvenient if there are dependency charts inside the `/chart/charts` directory. We don't necessarily want to add documentation for these charts to the README.md The `-g` option disables this.
```console
-g, --chart-to-generate strings    List of charts that will have documentation generated. Comma separated, no space. Empty list - generate for all charts in chart-search-root
```

Co-authored-by: Niladri Halder <niladri.halder26@gmail.com>
  • Loading branch information
mayastor-bors and niladrih committed Mar 14, 2024
2 parents 93c712c + d95fb2e commit 885f68c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/helm/generate-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

SCRIPTDIR=$(dirname "$0")
ROOTDIR="$SCRIPTDIR"/../../
TEMPLATE="$ROOTDIR/chart/README.md.tmpl"
README="$ROOTDIR/chart/README.md"
CHART_DIR="$ROOTDIR/chart"
TEMPLATE="$CHART_DIR/README.md.tmpl"
README="$CHART_DIR/README.md"
SKIP_GIT=${SKIP_GIT:-}

set -euo pipefail

helm-docs --dry-run -t "$TEMPLATE" > "$README"
helm-docs --dry-run -g "$CHART_DIR" -t "$TEMPLATE" > "$README"

if [ -z "$SKIP_GIT" ]; then
git diff --exit-code "$README"
Expand Down

0 comments on commit 885f68c

Please sign in to comment.