1
1
# VERSION defines the project version for the bundle.
2
2
# Update this value when you upgrade the version of your project.
3
3
# To re-generate a bundle for another specific version without changing the standard setup, you can:
4
- # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0 .0.2)
5
- # - use environment variables to overwrite this value (e.g export VERSION=0 .0.2)
4
+ # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=v0 .0.2)
5
+ # - use environment variables to overwrite this value (e.g export VERSION=v0 .0.2)
6
6
# best if we could detect this. If we cannot, we need to document it somewhere.
7
7
# then we can add a patch in the `PHONY: bundle`
8
+ # BUNDLE_VERSION is declared as bundle versioning doesn't use semver
8
9
9
- PREVIOUS_VERSION ?= 0.0.0-dev
10
- VERSION ?= 0.0.0-dev
10
+ PREVIOUS_VERSION ?= v0.0.0-dev
11
+ VERSION ?= v0.0.0-dev
12
+ BUNDLE_VERSION ?= $(VERSION:v%=% )
11
13
12
14
# INSTASCALE_VERSION defines the default version of the InstaScale controller
13
15
INSTASCALE_VERSION ?= v0.0.4
14
16
17
+ # OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
18
+ # OPERATORS_REPO_FORK_ORG points to GitHub repository fork organization where bundle build is pushed to
19
+ OPERATORS_REPO_ORG ?= redhat-openshift-ecosystem
20
+ OPERATORS_REPO_FORK_ORG ?= project-codeflare
21
+
15
22
# CHANNELS define the bundle channels used in the bundle.
16
23
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
17
24
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
@@ -46,10 +53,10 @@ INSTASCALE_IMAGE ?= $(IMAGE_ORG_BASE)/instascale-controller:$(INSTASCALE_VERSION
46
53
47
54
# BUNDLE_IMG defines the image:tag used for the bundle.
48
55
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
49
- BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:v $(VERSION )
56
+ BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:$(VERSION )
50
57
51
58
# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
52
- BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
59
+ BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(BUNDLE_VERSION ) $(BUNDLE_METADATA_OPTS )
53
60
54
61
# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests
55
62
# You can enable this value if you would like to use SHA Based Digests
@@ -60,7 +67,7 @@ ifeq ($(USE_IMAGE_DIGESTS), true)
60
67
endif
61
68
62
69
# Image URL to use all building/pushing image targets
63
- IMG ?= ${IMAGE_TAG_BASE}:v ${VERSION}
70
+ IMG ?= ${IMAGE_TAG_BASE}:${VERSION}
64
71
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
65
72
ENVTEST_K8S_VERSION = 1.24.2
66
73
@@ -239,7 +246,7 @@ bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle man
239
246
$(OPERATOR_SDK ) generate kustomize manifests -q
240
247
cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
241
248
cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
242
- cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.v $(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
249
+ cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
243
250
$(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle $(BUNDLE_GEN_FLAGS )
244
251
$(MAKE ) validate-bundle
245
252
git restore config/*
@@ -252,13 +259,13 @@ bundle-build: bundle ## Build the bundle image.
252
259
bundle-push : # # Push the bundle image.
253
260
$(MAKE ) image-push IMG=$(BUNDLE_IMG )
254
261
255
- .PHONY : openshift-community-operator-releases
262
+ .PHONY : openshift-community-operator-release
256
263
openshift-community-operator-release : install-gh-cli bundle # # build bundle and create PR in OpenShift community operators repository
257
- gh repo clone git @github.com:project-codeflare /community-operators-prod.git
258
- cd community-operators-prod && git pull upstream main && git push origin main
259
- cp -r bundle community-operators-prod/operators/codeflare-operator/$(VERSION )
260
- cd community-operators-prod && git checkout -b codeflare-release-$(VERSION ) && git add operators/codeflare-operator/$(VERSION ) /* && git commit -s - m " add bundle manifests codeflare version $( VERSION ) " && git push origin codeflare-release-$(VERSION )
261
- gh pr create --repo redhat-openshift-ecosystem /community-operators-prod --title " CodeFlare $( VERSION ) " --body " New release of codeflare operator" --head project-codeflare :codeflare-release-$(VERSION ) --base main
264
+ git clone https:// $( GH_TOKEN ) @github.com/ $( OPERATORS_REPO_FORK_ORG ) /community-operators-prod.git
265
+ cd community-operators-prod && git remote add upstream https://github.com/ $( OPERATORS_REPO_ORG ) /community-operators-prod.git && git pull upstream main && git push origin main
266
+ cp -r bundle community-operators-prod/operators/codeflare-operator/$(BUNDLE_VERSION )
267
+ cd community-operators-prod && git checkout -b codeflare-release-$(BUNDLE_VERSION ) && git add operators/codeflare-operator/$(BUNDLE_VERSION ) /* && git commit -m " add bundle manifests codeflare version $( BUNDLE_VERSION ) " && git push origin codeflare-release-$(BUNDLE_VERSION )
268
+ gh pr create --repo $( OPERATORS_REPO_FORK_ORG ) /community-operators-prod --title " CodeFlare $( BUNDLE_VERSION ) " --body " New release of codeflare operator" --head $( OPERATORS_REPO_ORG ) :codeflare-release-$(BUNDLE_VERSION ) --base main
262
269
rm -rf community-operators-prod
263
270
264
271
.PHONY : opm
@@ -283,7 +290,7 @@ endif
283
290
BUNDLE_IMGS ?= $(BUNDLE_IMG )
284
291
285
292
# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
286
- CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:v $(VERSION )
293
+ CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:$(VERSION )
287
294
288
295
# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
289
296
ifneq ($(origin CATALOG_BASE_IMG ) , undefined)
0 commit comments