ci: publish charts to TapTap/Charts
Replace the OCI chart push with a classic Helm repository in the public TapTap/Charts repository. CI packages the chart, regenerates index.yaml and pushes both to main, so `helm repo add` and Kustomize helmCharts work. The publisher authenticates with the AUDIOMANAGER_CHARTS_TOKEN secret and supports an explicit VERSION for local releases.
This commit is contained in:
1 parent
df3ed281f8
commit
0ac226b011
3 files changed
+109
-46
No files matched your search
@@ -704,50 +704,76 @@ UID 10001 (the chart sets `fsGroup: 10001`).
|
||||
The server exits at startup if a configured root path is missing or unreadable, so
|
||||
the pod will not pass its readiness probe in that case.
|
||||
|
||||
### 9.3 Chart registry
|
||||
### 9.3 Chart repository
|
||||
|
||||
CI packages the chart and pushes it to the Gitea OCI registry after the `chart`
|
||||
job passes. The package is available at:
|
||||
The chart source lives in `charts/audiomanager` in this repository. CI packages
|
||||
it and publishes the `.tgz` plus `index.yaml` to the public `TapTap/Charts`
|
||||
repository:
|
||||
|
||||
```text
|
||||
oci://gitea.tap-tap.win/taptap/charts/audiomanager
|
||||
https://gitea.tap-tap.win/TapTap/Charts/raw/branch/main
|
||||
```
|
||||
|
||||
This is a classic Helm repository, so it supports both `helm repo add` and
|
||||
Kustomize's `helmCharts` generator. The chart repository is public; the image
|
||||
registry remains private.
|
||||
|
||||
Versions published by CI:
|
||||
|
||||
- `main`: `<chart version>-sha.<commit>`, for example `0.1.2-sha.<commit>`
|
||||
- `v*` tag: the tag without the leading `v`, for example `v0.2.0` -> `0.2.0`
|
||||
|
||||
The registry is private, and Helm keeps its own credentials (a Docker login is
|
||||
not enough):
|
||||
Use it with Helm:
|
||||
|
||||
```bash
|
||||
helm registry login gitea.tap-tap.win -u TapTap
|
||||
helm repo add taptap \
|
||||
https://gitea.tap-tap.win/TapTap/Charts/raw/branch/main
|
||||
helm repo update
|
||||
helm search repo taptap/audiomanager
|
||||
```
|
||||
|
||||
Install a published chart:
|
||||
|
||||
```bash
|
||||
VERSION="0.1.2-sha.<commit>"
|
||||
helm upgrade --install audiomanager \
|
||||
oci://gitea.tap-tap.win/taptap/charts/audiomanager \
|
||||
helm upgrade --install audiomanager taptap/audiomanager \
|
||||
--version "$VERSION" \
|
||||
--namespace audiomanager \
|
||||
--set users.existingSecret=audiomanager-users \
|
||||
--set imagePullSecrets[0].name=audiomanager-registry
|
||||
```
|
||||
|
||||
Replace `VERSION` with the commit build shown in Gitea Actions or the package
|
||||
list.
|
||||
For Kustomize, use the same repository with `build --enable-helm`:
|
||||
|
||||
To package and push from a workstation, run `helm registry login` first and then:
|
||||
|
||||
```bash
|
||||
scripts/push-chart.sh # version from CI env, git, or Chart.yaml
|
||||
VERSION=0.2.0 scripts/push-chart.sh # explicit version
|
||||
```yaml
|
||||
helmCharts:
|
||||
- name: audiomanager
|
||||
releaseName: audiomanager
|
||||
namespace: audiomanager
|
||||
repo: https://gitea.tap-tap.win/TapTap/Charts/raw/branch/main
|
||||
version: 0.1.2-sha.<commit>
|
||||
valuesFile: values.yaml
|
||||
```
|
||||
|
||||
The script writes the `.tgz` to `dist/`, which is ignored by git.
|
||||
```bash
|
||||
kustomize build --enable-helm deploy/overlays/prod | kubectl apply -f -
|
||||
```
|
||||
|
||||
`kubectl apply -k` does not run the Helm inflator; render with `kustomize build
|
||||
--enable-helm` (or `kubectl kustomize --enable-helm`) first. Kustomize's Helm
|
||||
generator cannot authenticate, which is why `TapTap/Charts` is public.
|
||||
|
||||
To publish from a workstation, either configure git credentials for
|
||||
`TapTap/Charts` or pass a token explicitly:
|
||||
|
||||
```bash
|
||||
CHARTS_TOKEN=<token> scripts/push-chart.sh
|
||||
VERSION=0.2.0 CHARTS_TOKEN=<token> scripts/push-chart.sh
|
||||
```
|
||||
|
||||
The CI job uses the `AUDIOMANAGER_CHARTS_TOKEN` repository secret. The script
|
||||
clones the chart repository, adds the packaged chart, regenerates `index.yaml`
|
||||
and pushes to `main`.
|
||||
|
||||
### 9.4 Operations
|
||||
|
||||
|
||||
Reference in new issue
Block a user