Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add check-update-docs scripts #92

Merged
merged 5 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/scripts/check-update-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

TMP_DIR=/tmp/greptime-chart-tmp
CHART_DIRS=(charts)

function copy_original_files() {
rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"
for dir in "${CHART_DIRS[@]}"; do
cp -r "${dir}" "${TMP_DIR}"/"${dir}"
done
}

function run_update_docs() {
make update-docs
}

function check_diff() {
for dir in "${CHART_DIRS[@]}"; do
diff -Naupr "${dir}" "${TMP_DIR}"/"${dir}" || (echo \'"${dir}"/\' is out of date, please run \'make update-docs\' && exit 1)
done
}

copy_original_files
run_update_docs
check_diff
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
with:
fetch-depth: 0

- name: Check update docs
daviderli614 marked this conversation as resolved.
Show resolved Hide resolved
run: |
make check-update-docs

- name: Install Helm
uses: azure/setup-helm@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ update-docs: install-helm-docs ## Run helm-docs
$(GOBIN)/helm-docs -c charts/greptimedb-cluster --chart-search-root=charts/greptimedb-cluster --template-files=README.md.gotmpl
$(GOBIN)/helm-docs -c charts/greptimedb-operator --chart-search-root=charts/greptimedb-operator --template-files=README.md.gotmpl
$(GOBIN)/helm-docs -c charts/greptimedb-standalone --chart-search-root=charts/greptimedb-standalone --template-files=README.md.gotmpl

.PHONY: check-update-docs
check-update-docs: ## Check update docs.
echo "Checking update docs"
.github/scripts/check-update-docs.sh

Loading