@@ -187,18 +187,31 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
187
187
CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
188
188
ENVTEST ?= $(LOCALBIN ) /setup-envtest
189
189
OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
190
+ GH_CLI ?= $(LOCALBIN ) /gh
190
191
191
192
# # Tool Versions
192
193
KUSTOMIZE_VERSION ?= v4.5.4
193
194
CONTROLLER_TOOLS_VERSION ?= v0.9.2
194
195
OPERATOR_SDK_VERSION ?= v1.27.0
196
+ GH_CLI_VERSION ?= 2.30.0
195
197
196
198
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
197
199
.PHONY : kustomize
198
200
kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
199
201
$(KUSTOMIZE ) : $(LOCALBIN )
200
202
test -s $(LOCALBIN ) /kustomize || { curl -s $( KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $( subst v,,$( KUSTOMIZE_VERSION) ) $( LOCALBIN) ; }
201
203
204
+ GH_CLI_DL_URL := https://github.com/cli/cli/releases/download/v$(GH_CLI_VERSION )
205
+ GH_CLI_DL_FILENAME := gh_$(GH_CLI_VERSION ) _$(shell go env GOOS) _$(shell go env GOARCH)
206
+ .PHONY : install-gh-cli
207
+ install-gh-cli : $(GH_CLI )
208
+ $(GH_CLI ) : $(LOCALBIN )
209
+ curl -L $(GH_CLI_DL_URL ) /$(GH_CLI_DL_FILENAME ) .tar.gz --output $(GH_CLI_DL_FILENAME ) .tar.gz
210
+ tar -xvzf $(GH_CLI_DL_FILENAME ) .tar.gz
211
+ cp $(GH_CLI_DL_FILENAME ) /bin/gh $(GH_CLI )
212
+ rm -rf $(GH_CLI_DL_FILENAME )
213
+ rm $(GH_CLI_DL_FILENAME ) .tar.gz
214
+
202
215
.PHONY : controller-gen
203
216
controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
204
217
$(CONTROLLER_GEN ) : $(LOCALBIN )
@@ -237,6 +250,15 @@ bundle-build: bundle ## Build the bundle image.
237
250
bundle-push : # # Push the bundle image.
238
251
$(MAKE ) image-push IMG=$(BUNDLE_IMG )
239
252
253
+ .PHONY : openshift-community-operator-releases
254
+ openshift-community-operator-release : install-gh-cli bundle # # build bundle and create PR in OpenShift community operators repository
255
+ gh repo clone
[email protected] :project-codeflare/community-operators-prod.git
256
+ cd community-operators-prod && git pull upstream main && git push origin main
257
+ cp -r bundle community-operators-prod/operators/codeflare-operator/$(VERSION )
258
+ 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 )
259
+ 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
260
+ rm -rf community-operators-prod
261
+
240
262
.PHONY : opm
241
263
OPM = ./bin/opm
242
264
opm : # # Download opm locally if necessary.
0 commit comments