|
3 | 3 | # To re-generate a bundle for another specific version without changing the standard setup, you can: |
4 | 4 | # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) |
5 | 5 | # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) |
6 | | -VERSION ?= 0.8.0 |
| 6 | +VERSION ?= 0.8.1-rc.1 |
| 7 | + |
| 8 | +# REPLACES defines the previous operator version this release replaces in the OLM upgrade graph. |
| 9 | +# Used to generate the release-config.yaml for FBC auto-release. |
| 10 | +# Set to empty for the first release in a channel. |
| 11 | +# See: https://redhat-openshift-ecosystem.github.io/operator-pipelines/users/fbc_autorelease/ |
| 12 | +REPLACES ?= jumpstarter-operator.v0.8.0 |
| 13 | + |
| 14 | +# FBC_CHANNELS defines the FBC catalog channels for this release. |
| 15 | +FBC_CHANNELS ?= alpha |
| 16 | + |
| 17 | +# OPENSHIFT_VERSIONS defines the Red Hat OpenShift version range injected into bundle metadata. |
| 18 | +OPENSHIFT_VERSIONS ?= v4.18-v4.21 |
7 | 19 |
|
8 | 20 | # CHANNELS define the bundle channels used in the bundle. |
9 | 21 | # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") |
@@ -305,7 +317,27 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada |
305 | 317 | $(OPERATOR_SDK) generate kustomize manifests -q |
306 | 318 | cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) |
307 | 319 | $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) |
| 320 | + @# Inject Red Hat OpenShift version range into bundle metadata (not handled by operator-sdk) |
| 321 | + @if ! grep -q 'com.redhat.openshift.versions' bundle/metadata/annotations.yaml; then \ |
| 322 | + echo ' com.redhat.openshift.versions: $(OPENSHIFT_VERSIONS)' >> bundle/metadata/annotations.yaml; \ |
| 323 | + fi |
308 | 324 | $(OPERATOR_SDK) bundle validate ./bundle |
| 325 | + @# Generate release-config.yaml for FBC auto-release |
| 326 | + @echo "---" > bundle/release-config.yaml |
| 327 | + @echo "catalog_templates:" >> bundle/release-config.yaml |
| 328 | + @echo " - template_name: basic.yaml" >> bundle/release-config.yaml |
| 329 | + @echo " channels: [$(FBC_CHANNELS)]" >> bundle/release-config.yaml |
| 330 | +ifneq ($(REPLACES),) |
| 331 | + @echo " replaces: $(REPLACES)" >> bundle/release-config.yaml |
| 332 | + @REPLACES_VER=$$(echo "$(REPLACES)" | sed 's/jumpstarter-operator\.v//'); \ |
| 333 | + echo " skipRange: '>=$${REPLACES_VER} <$(VERSION)'" >> bundle/release-config.yaml |
| 334 | +endif |
| 335 | + @echo "Generated bundle/release-config.yaml" |
| 336 | + |
| 337 | +.PHONY: contribute |
| 338 | +contribute: bundle ## Update community-operators repos with the current bundle. |
| 339 | + cd contribute && \ |
| 340 | + ./update-contributions.sh |
309 | 341 |
|
310 | 342 | .PHONY: bundle-build |
311 | 343 | bundle-build: ## Build the bundle image. |
|
0 commit comments