11# fix for some Linux distros (i.e. WSL)
22SHELL := /usr/bin/env bash
33
4+ # CONTAINER ENGINE: docker | podman
5+ CONTAINER_ENGINE? =docker
6+
47# VERSION defines the project version for the bundle.
58# Update this value when you upgrade the version of your project.
69# To re-generate a bundle for another specific version without changing the standard setup, you can:
1720# To re-generate a bundle for other specific channels without changing the standard setup, you can:
1821# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=preview,fast,stable)
1922# - use environment variables to overwrite this value (e.g export CHANNELS="preview,fast,stable")
20- CHANNELS = beta
23+ CHANNELS ? = beta
2124ifneq ($(origin CHANNELS ) , undefined)
2225BUNDLE_CHANNELS := --channels=$(CHANNELS )
2326endif
2730# To re-generate a bundle for any other default channel without changing the default setup, you can:
2831# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable)
2932# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable")
30- DEFAULT_CHANNEL = beta
33+ DEFAULT_CHANNEL ?= beta
3134ifneq ($(origin DEFAULT_CHANNEL ) , undefined)
3235BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL )
3336endif
@@ -88,6 +91,10 @@ int-test: generate manifests ## Run integration tests. Sample with labels: `make
8891e2e : run-kind # # Run e2e test. Command `make e2e label=cluster-ns` run cluster-ns test
8992 ./scripts/e2e_local.sh $(label ) $(build )
9093
94+ .PHONY : e2e-openshift-upgrade
95+ e2e-openshift-upgrade :
96+ cd scripts && ./openshift-upgrade-test.sh
97+
9198.PHONY : manager
9299manager : generate fmt vet # # Build manager binary
93100 go build -o bin/manager -ldflags=" -X main.version=$( PRODUCT_VERSION) " cmd/manager/main.go
@@ -163,20 +170,19 @@ bundle: manifests kustomize ## Generate bundle manifests and metadata, then vali
163170
164171.PHONY : image
165172image : manager # # Build the operator image
166- docker build -t $(OPERATOR_IMAGE ) .
167- docker push $(OPERATOR_IMAGE )
173+ $( CONTAINER_ENGINE ) build -t $(OPERATOR_IMAGE ) .
174+ $( CONTAINER_ENGINE ) push $(OPERATOR_IMAGE )
168175
169176.PHONY : bundle-build
170177bundle-build : # # Build the bundle image.
171- docker build -f bundle.Dockerfile -t $(BUNDLE_IMG ) .
178+ $( CONTAINER_ENGINE ) build -f bundle.Dockerfile -t $(BUNDLE_IMG ) .
172179
173180.PHONY : bundle-push
174- bundle-push : bundle bundle-build # # Publish the bundle image
175- docker push $(BUNDLE_IMG )
181+ bundle-push :
182+ $( CONTAINER_ENGINE ) push $(BUNDLE_IMG )
176183
177184.PHONY : catalog-build
178185CATALOG_DIR ?= ./scripts/openshift/atlas-catalog
179- # catalog-build: IMG=
180186catalog-build : # # bundle bundle-push ## Build file-based bundle
181187 $(MAKE ) image IMG=$(REGISTRY ) /mongodb-atlas-operator:$(VERSION )
182188 CATALOG_DIR=$(CATALOG_DIR ) \
@@ -188,7 +194,7 @@ catalog-build: ## bundle bundle-push ## Build file-based bundle
188194
189195.PHONY : catalog-push
190196catalog-push :
191- docker push $(CATALOG_IMAGE )
197+ $( CONTAINER_ENGINE ) push $(CATALOG_IMAGE )
192198
193199.PHONY : build-subscription
194200build-subscription :
@@ -219,9 +225,9 @@ deploy-olm: bundle-build bundle-push catalog-build catalog-push build-catalogsou
219225# # docker-login-olm:
220226# # docker login -u $(shell oc whoami) -p $(shell oc whoami -t) $(REGISTRY)
221227
222- .PHONY : docker -push
223- docker -push : # # Push the docker image
224- docker push ${IMG}
228+ .PHONY : image -push
229+ image -push : # # Push the docker image
230+ $( CONTAINER_ENGINE ) push ${IMG}
225231
226232# Additional make goals
227233.PHONY : run-kind
0 commit comments