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

Replace frigate with helm-docs #160

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
23 changes: 1 addition & 22 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Frigate
run: pip install frigate
- name: Check if chart README is in-sync
run: |
frigate gen charts/trino > charts/trino/README.md
if ! git diff --exit-code --quiet; then
cat << 'EOF'
charts/trino/README.md is not in sync with chart
Please update charts/trino/README.md by running:
python3 -m venv .venv && . .venv/bin/activate
pip install frigate
frigate gen charts/trino > charts/trino/README.md

Here's a diff of what's changed:
EOF

git diff
# fail the job
exit 1
else
echo "charts/trino/README.md is in-sync with chart"
fi
- uses: pre-commit/action@v3.0.1

# Everything above is CI, everything here and below is for releases and runs only on non-pull-request events
sync-readme:
Expand Down
2 changes: 2 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
.project
.idea/
*.tmproj
# helm-doc template
README.md.gotmpl
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md
- id: end-of-file-fixer
- repo: https://github.com/norwoodj/helm-docs
rev: v1.13.1
hooks:
- id: helm-docs-container
args:
- --chart-search-root=charts
- --document-dependency-values
- --sort-values-order=file
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Then you can install chart using:
helm install my-trino trino/trino --version 0.21.0
```

Also, you can check the manifests using:
Also, you can check the manifests using:

```console
helm template my-trino trino/trino --namespace <YOUR_NAMESPACE>
Expand All @@ -34,3 +34,40 @@ helm template my-trino trino/trino --namespace <YOUR_NAMESPACE>
## Documentation

You can find documentation about the chart [here](./charts/trino/README.md).

## Development

To test the chart, install it into a Kubernetes cluster. Use `kind` to create a
Kubernetes cluster running in a container, and `chart-testing` to install the
chart and run [tests](charts/trino/templates/tests).

```console
brew install helm kind chart-testing
kind create cluster
ct install
```

To run tests with specific values:
```console
ct install --helm-extra-set-args "--set image.tag=448"
```

Use the `test.sh` script to run a suite of tests, with different chart values.
If some of the tests fail, use the `-s` flag to skip cleanup and inspect the
resources installed in the Kubernetes cluster. Use `-n` to use a specific
namespace, not a randomly generated one. Use `-t` to run only selected tests.
See the command help (`-h`) for a list of available tests.

Example:
```console
./test.sh -n trino -s -t default
```

The documentation is automatically generated from the chart files. Install a
git hook to have it automatically updated when committing changes. Make sure
you [install the pre-commit binary](https://pre-commit.com/#install), then run:

```console
pre-commit install
pre-commit install-hooks
```
Loading