|
| 1 | +# Release version: the current git tag without the "v" prefix (v0.1.2 -> |
| 2 | +# 0.1.2; between tags, git describe appends -<n>-g<sha>). goreleaser overrides |
| 3 | +# it on the make command line (see the before hook in .goreleaser.yaml) so the |
| 4 | +# Makefile and goreleaser always agree on one value. |
| 5 | +VERSION ?= $(shell git describe --tags | sed -e 's/^v//') |
| 6 | + |
1 | 7 | # Image URL to use all building/pushing image targets |
2 | 8 | IMAGE_REPO ?= ghcr.io/oxidecomputer/cluster-api-provider-oxide |
3 | 9 | HELM_OCI_REPO ?= $(IMAGE_REPO)/helm-charts |
@@ -235,12 +241,26 @@ run: generate ## Run a controller from your host. |
235 | 241 |
|
236 | 242 | .PHONY: manifests |
237 | 243 | manifests: generate |
238 | | - mkdir -p $(ARTIFACTS) |
| 244 | +# Package the charts at $(VERSION): helm template has no --app-version flag, |
| 245 | +# so the version-derived output (app.kubernetes.io/version) can only carry the |
| 246 | +# release version if the manifest is rendered from a packaged chart rather |
| 247 | +# than the chart dir (whose Chart.yaml holds a placeholder). The rm clears |
| 248 | +# stale tarballs so the `make release` helm push step only sees this version's. |
| 249 | + rm -rf $(ARTIFACTS)/helm |
| 250 | + mkdir -p $(ARTIFACTS)/helm |
| 251 | + $(HELM) package charts/cluster-api-provider-oxide \ |
| 252 | + --version $(VERSION) \ |
| 253 | + --app-version $(VERSION) \ |
| 254 | + --destination $(ARTIFACTS)/helm |
| 255 | + $(HELM) package charts/cluster-api-provider-oxide-crds \ |
| 256 | + --version $(VERSION) \ |
| 257 | + --app-version $(VERSION) \ |
| 258 | + --destination $(ARTIFACTS)/helm |
239 | 259 | # helm never emits a Namespace object, so prepend one. The sed strips the |
240 | 260 | # helm-specific labels the chart renders (helm.sh/chart, managed-by: Helm); |
241 | 261 | # nothing in this manifest is managed by a helm release. |
242 | 262 | printf 'apiVersion: v1\nkind: Namespace\nmetadata:\n name: $(NAMESPACE)\n---\n' > $(ARTIFACTS)/infrastructure-components.yaml |
243 | | - $(HELM) template capox charts/cluster-api-provider-oxide \ |
| 263 | + $(HELM) template capox $(ARTIFACTS)/helm/cluster-api-provider-oxide-$(VERSION).tgz \ |
244 | 264 | --namespace $(NAMESPACE) \ |
245 | 265 | --include-crds \ |
246 | 266 | --set image.repository=$(IMAGE_REPO) \ |
|
0 commit comments