Skip to content

Commit

Permalink
run helm-docs as quarto pre-render
Browse files Browse the repository at this point in the history
  • Loading branch information
edavidaja committed May 10, 2024
1 parent 3793d6c commit f8a4c2a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/chart-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@ jobs:
with:
version: v3.6.3

- name: install Just
uses: extractions/setup-just@v2

- name: Install helm-docs
env:
version: 1.5.0
HELM_DOCS_VERSION: 1.13.1
run: |
echo "Installing helm-docs version $version"
curl -L -o helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_${version}_Linux_x86_64.tar.gz
tar -xzvf helm-docs.tar.gz helm-docs
rm -rf helm-docs.tar.gz
just setup
- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: pre-release

- name: Run helm-docs
run: |
./helm-docs --chart-search-root=charts --template-files=README.md.gotmpl --template-files=./_templates.gotmpl
./helm-docs --chart-search-root=other-charts --template-files=README.md.gotmpl --template-files=./_templates.gotmpl
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2

- name: Commit results
run: |
Expand Down Expand Up @@ -62,13 +65,12 @@ jobs:
with:
version: v3.6.3

- name: install Just
uses: extractions/setup-just@v2

- name: Compute and update dependent files
run: |
set -xe
cd ./charts/rstudio-launcher-rbac && helm dependency build && cd -
helm template -n rstudio rstudio-launcher-rbac ./charts/rstudio-launcher-rbac --set removeNamespaceReferences=true > examples/rbac/rstudio-launcher-rbac.yaml
CHART_VERSION=$(helm show chart ./charts/rstudio-launcher-rbac | grep '^version' | cut -d ' ' -f 2)
cp examples/rbac/rstudio-launcher-rbac.yaml examples/rbac/rstudio-launcher-rbac-${CHART_VERSION}.yaml
just rbac
- name: Commit results
run: |
Expand Down
15 changes: 9 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
DIFF := "diff"
HELM_DOCS_VERSION := env_var_or_default("HELM_DOCS_VERSION", "1.13.1")
OS := if os() == "macos" {"Darwin"} else if os() == "linux" {"Linux"} else if os() == "windows" {"Windows"} else {""}
ARCH := if arch() == "aarch64" {"arm64"} else if arch() == "x86_64" {"x86_64"} else {""}

setup:
#!/bin/bash
# TODO: idempotency

# TODO: check for macos
mkdir -p ./bin/helm-docs-1.5.0/
curl -L https://github.com/norwoodj/helm-docs/releases/download/v1.5.0/helm-docs_1.5.0_Darwin_x86_64.tar.gz | tar -xzvf - -C ./bin/helm-docs-1.5.0/
ln -s $PWD/bin/helm-docs-1.5.0/helm-docs $PWD/bin/helm-docs
set -xe
echo "Installing helm-docs version {{HELM_DOCS_VERSION}}"
mkdir -p bin
curl -L -s https://github.com/norwoodj/helm-docs/releases/download/v{{HELM_DOCS_VERSION}}/helm-docs_{{HELM_DOCS_VERSION}}_{{OS}}_{{ARCH}}.tar.gz -o bin/helm-docs.tar.gz
tar -C ./bin -xz -f bin/helm-docs.tar.gz helm-docs
rm -rf bin/helm-docs.tar.gz

update-lock:
#!/bin/bash
Expand Down
4 changes: 2 additions & 2 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
project:
type: posit-docs
pre-render: |
./helm-docs --chart-search-root=charts --template-files=README.md.gotmpl --template-files=./_templates.gotmpl
./helm-docs --chart-search-root=other-charts --template-files=README.md.gotmpl --template-files=./_templates.gotmpl
./bin/helm-docs --chart-search-root=charts --template-files=README.md.gotmpl --template-files=./_templates.gotmpl
./bin/helm-docs --chart-search-root=other-charts --template-files=README.md.gotmpl --template-files=./_templates.gotmpl
render:
- charts/rstudio-workbench/README.md
- charts/rstudio-workbench/NEWS.md
Expand Down

0 comments on commit f8a4c2a

Please sign in to comment.