check-helm-docs.sh 1020 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # check-helm-docs.sh - Make sure helm docs are up to date
  12. set -euo pipefail
  13. cd "$(dirname "$0")/../../../.."
  14. . misc/shlib/shlib.bash
  15. if ! helm-docs --version >/dev/null 2>/dev/null; then
  16. echo "lint: helm-docs is not installed"
  17. echo "hint: refer to https://github.com/norwoodj/helm-docs?tab=readme-ov-file#installation for install instructions"
  18. fi
  19. ci_collapsed_heading "Verify that helm docs are up-to-date"
  20. HELM_CHARTS_DIR=misc/helm-charts/operator
  21. TEMP_DIR=$(mktemp -d)
  22. cp -a $HELM_CHARTS_DIR/. "$TEMP_DIR"
  23. helm-docs -c "$TEMP_DIR"
  24. try diff -r $HELM_CHARTS_DIR "$TEMP_DIR"
  25. rm -rf "$TEMP_DIR"
  26. try_status_report