- Shell 100%
Like blauwe-knop, every component keeps its chart and releases it with a version; one shared script packages and uploads, so the 21 component pipelines do not each carry their own copy. |
||
|---|---|---|
| .forgejo/workflows | ||
| bin | ||
| test/voorbeeld | ||
| LICENSE | ||
| README.md | ||
charts
The Helm charts of Notificatie voor Burgers, released per component. The charts themselves stay in
each component's repository, in its helm/ folder, next to the code they deploy. This repository
holds how they are published and how an environment uses them (ADR 0007 in getting-started).
The charts live in the Helm registry of the mijn-betaaloverzicht organisation on Forgejo, which
keeps the index itself:
helm repo add mijnbo https://code.digitaledienst.overheid.nl/api/packages/mijn-betaaloverzicht/helm
helm search repo mijnbo --versions
Versions
Each component has its own SemVer version, in helm/Chart.yaml. A release tag vX.Y.Z publishes:
- the image, tagged
X.Y.ZandvX.Y.Z(next to the commit SHA every push tomaingets); - the chart at version
X.Y.Z, whoseappVersionisX.Y.Ztoo, so its default image tag is that same release.
A chart and an image with the same version therefore always belong together. Pushes to main only
lint and render the chart; nothing is published until a tag.
Releasing a component
In the component's repository, on an up-to-date main:
make release VERSION=1.2.3 # writes the version into helm/Chart.yaml, commits and tags v1.2.3
git push --follow-tags # CI builds the image and publishes the chart
A person bumps the version, not a bot: that keeps CI from pushing to main, and the version says
what changed only when someone decides it. A published version never changes; the registry refuses
to overwrite it.
Publishing from CI
A component's tag pipeline downloads bin/publish-chart.sh and runs it with the organisation secrets that already push the images:
- name: Publish the chart
env:
SERVER: ${{ forgejo.server_url }}
VERSION: ${{ forgejo.ref_name }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -eu
wget -q -O /tmp/publish-chart.sh "${SERVER}/mijn-betaaloverzicht/charts/raw/branch/main/bin/publish-chart.sh"
sh /tmp/publish-chart.sh helm "${VERSION#v}"
The script refuses a version that differs from helm/Chart.yaml, lints, packages and uploads.
DRY_RUN=1 packages without uploading.
Using a version in an environment
environments/<environment>/versions pins a release per component (component=1.2.3); its
bin/deploy.sh installs that chart version from the registry. A pin that is still a commit SHA
deploys the chart from that commit, as before, until the component has its first release.
Locally, getting-started keeps deploying straight from the helm/ folders next to it, so a change
can be tried without a release.