@@ -155,18 +155,31 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
155155CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
156156ENVTEST ?= $(LOCALBIN ) /setup-envtest
157157OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
158+ GH_CLI ?= $(LOCALBIN ) /gh
158159
159160# # Tool Versions
160161KUSTOMIZE_VERSION ?= v3.8.7
161162CONTROLLER_TOOLS_VERSION ?= v0.9.2
162163OPERATOR_SDK_VERSION ?= v1.27.0
164+ GH_CLI_VERSION ?= 2.30.0
163165
164166KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
165167.PHONY : kustomize
166168kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
167169$(KUSTOMIZE ) : $(LOCALBIN )
168170 test -s $(LOCALBIN ) /kustomize || { curl -s $( KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $( subst v,,$( KUSTOMIZE_VERSION) ) $( LOCALBIN) ; }
169171
172+ GH_CLI_DL_URL := https://github.com/cli/cli/releases/download/v$(GH_CLI_VERSION )
173+ GH_CLI_DL_FILENAME := gh_$(GH_CLI_VERSION ) _$(shell go env GOOS) _$(shell go env GOARCH)
174+ .PHONY : install-gh-cli
175+ install-gh-cli : $(GH_CLI )
176+ $(GH_CLI ) : $(LOCALBIN )
177+ curl -L $(GH_CLI_DL_URL ) /$(GH_CLI_DL_FILENAME ) .tar.gz --output $(GH_CLI_DL_FILENAME ) .tar.gz
178+ tar -xvzf $(GH_CLI_DL_FILENAME ) .tar.gz
179+ cp $(GH_CLI_DL_FILENAME ) /bin/gh $(GH_CLI )
180+ rm -rf $(GH_CLI_DL_FILENAME )
181+ rm $(GH_CLI_DL_FILENAME ) .tar.gz
182+
170183.PHONY : controller-gen
171184controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
172185$(CONTROLLER_GEN ) : $(LOCALBIN )
@@ -204,6 +217,15 @@ bundle-build: ## Build the bundle image.
204217bundle-push : # # Push the bundle image.
205218 $(MAKE ) image-push IMG=$(BUNDLE_IMG )
206219
220+ .PHONY : openshift-community-operator-releases
221+ openshift-community-operator-release : install-gh-cli bundle # # build bundle and create PR in OpenShift community operators repository
222+ gh repo clone
[email protected] :project-codeflare/community-operators-prod.git
223+ cd community-operators-prod && git pull upstream main && git push origin main
224+ cp -r bundle community-operators-prod/operators/codeflare-operator/$(VERSION )
225+ cd community-operators-prod && git checkout -b codeflare-release-$(VERSION ) && git add operators/codeflare-operator/$(VERSION ) /* && git commit -m " add bundle manifests codeflare version $( VERSION) " && git push origin codeflare-release-$(VERSION )
226+ 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
227+ rm -rf community-operators-prod
228+
207229.PHONY : opm
208230OPM = ./bin/opm
209231opm : # # Download opm locally if necessary.
0 commit comments