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
@@ -19,6 +21,11 @@ MCAD_REF ?= release-${MCAD_VERSION}
19
21
MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher
20
22
MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_REF}
21
23
24
+ # OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
25
+ # OPERATORS_REPO_FORK_ORG points to GitHub repository fork organization where bundle build is pushed to
26
+ OPERATORS_REPO_ORG ?= redhat-openshift-ecosystem
27
+ OPERATORS_REPO_FORK_ORG ?= project-codeflare
28
+
22
29
# CHANNELS define the bundle channels used in the bundle.
23
30
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
24
31
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
@@ -53,10 +60,10 @@ INSTASCALE_IMAGE ?= $(IMAGE_ORG_BASE)/instascale-controller:$(INSTASCALE_VERSION
53
60
54
61
# BUNDLE_IMG defines the image:tag used for the bundle.
55
62
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
56
- BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:v $(VERSION )
63
+ BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:$(VERSION )
57
64
58
65
# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
59
- BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
66
+ BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(BUNDLE_VERSION ) $(BUNDLE_METADATA_OPTS )
60
67
61
68
# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests
62
69
# You can enable this value if you would like to use SHA Based Digests
@@ -67,7 +74,7 @@ ifeq ($(USE_IMAGE_DIGESTS), true)
67
74
endif
68
75
69
76
# Image URL to use all building/pushing image targets
70
- IMG ?= ${IMAGE_TAG_BASE}:v ${VERSION}
77
+ IMG ?= ${IMAGE_TAG_BASE}:${VERSION}
71
78
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
72
79
ENVTEST_K8S_VERSION = 1.24.2
73
80
@@ -308,7 +315,7 @@ bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle man
308
315
$(KUSTOMIZE ) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_CRD=$(MCAD_CRD )
309
316
cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
310
317
cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
311
- cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.v $(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
318
+ cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
312
319
$(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle $(BUNDLE_GEN_FLAGS )
313
320
$(MAKE ) validate-bundle
314
321
git restore config/*
@@ -321,13 +328,13 @@ bundle-build: bundle ## Build the bundle image.
321
328
bundle-push : # # Push the bundle image.
322
329
$(MAKE ) image-push IMG=$(BUNDLE_IMG )
323
330
324
- .PHONY : openshift-community-operator-releases
331
+ .PHONY : openshift-community-operator-release
325
332
openshift-community-operator-release : install-gh-cli bundle # # build bundle and create PR in OpenShift community operators repository
326
- gh repo clone git @github.com:project-codeflare /community-operators-prod.git
327
- cd community-operators-prod && git pull upstream main && git push origin main
328
- cp -r bundle community-operators-prod/operators/codeflare-operator/$(VERSION )
329
- 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 )
330
- 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
333
+ git clone https:// $( GH_TOKEN ) @github.com/ $( OPERATORS_REPO_FORK_ORG ) /community-operators-prod.git
334
+ 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
335
+ cp -r bundle community-operators-prod/operators/codeflare-operator/$(BUNDLE_VERSION )
336
+ 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 )
337
+ 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
331
338
rm -rf community-operators-prod
332
339
333
340
.PHONY : opm
@@ -352,7 +359,7 @@ endif
352
359
BUNDLE_IMGS ?= $(BUNDLE_IMG )
353
360
354
361
# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
355
- CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:v $(VERSION )
362
+ CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:$(VERSION )
356
363
357
364
# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
358
365
ifneq ($(origin CATALOG_BASE_IMG ) , undefined)
0 commit comments