Files
helm-charts/README.md
2025-11-17 17:37:30 +08:00

47 lines
1.5 KiB
Markdown

# helm-charts repo
This repository manages two Helm charts (e.g., `code-server-chart`, `vllm-serve`) and automates packaging and publishing on every `git push` (local pre-push hook only; no CI runner required).
## How it works
- Local pre-push hook runs `scripts/helm_publish.sh` and only processes charts that changed relative to the branch upstream (initial push publishes all charts).
- If any processed chart fails to package/push, the Git push is aborted.
## Configure registry
1. Create `.env` and fill in:
```
HELM_OCI_NAMESPACE=gitea.example.com/your-user
HELM_USERNAME=your-username
HELM_PASSWORD=your-token-or-password
```
The charts are pushed to `oci://$HELM_OCI_NAMESPACE` (Helm appends the chart name and version). For self-signed or HTTP registries, you can add:
```
HELM_PUSH_EXTRA_ARGS="--insecure-skip-tls-verify --plain-http"
HELM_LOGIN_EXTRA_ARGS="--insecure --plain-http"
ALLOW_OVERWRITE=1
```
When `ALLOW_OVERWRITE=1` is set, the pre-push will first try to delete the existing `<chart>:<version>` tag from Harbor via API (requires `HELM_USERNAME`/`HELM_PASSWORD`). This is needed because OCI registries do not allow overwriting tags.
## Chart discovery
No configuration needed by default. The script auto-discovers chart directories by looking for `Chart.yaml` up to depth 2 (excluding nested `charts/` vendor dir).
By default you don't need to set `CHART_DIRS`; the hook processes only the charts that changed.
## Run manually
```
./scripts/helm_publish.sh
```
Use `DRY_RUN=1` to only package locally:
```
DRY_RUN=1 ./scripts/helm_publish.sh
```