11
2+ IMAGE ?= localhost/postgres-operator:latest
23PGMONITOR_DIR ?= hack/tools/pgmonitor
34PGMONITOR_VERSION ?= v5.2.1
45QUERIES_CONFIG_DIR ?= hack/tools/queries
@@ -44,7 +45,7 @@ notes: ## List known issues and future considerations
4445.PHONY : clean
4546clean : # # Clean resources
4647clean : clean-deprecated
47- rm -f bin/postgres-operator
48+ rm -f bin/postgres-operator image.tar
4849 rm -rf licenses/* /
4950 [ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
5051 [ ! -d hack/tools/envtest ] || { chmod -R u+w hack/tools/envtest && rm -r hack/tools/envtest; }
@@ -133,7 +134,7 @@ deploy-dev: createnamespaces
133134
134135.PHONY : build
135136build : # # Build a postgres-operator image
136- $(BUILDAH ) build --tag localhost/postgres-operator \
137+ $(BUILDAH ) build --tag ' $(IMAGE) ' \
137138 --label org.opencontainers.image.authors=' Crunchy Data' \
138139 --label org.opencontainers.image.description=' Crunchy PostgreSQL Operator' \
139140 --label org.opencontainers.image.revision=' $(shell git rev-parse HEAD)' \
@@ -146,7 +147,11 @@ build-kind: image.tar ; $(or $(KIND),kind) load image-archive $<
146147build-minikube : image.tar ; $(or $(MINIKUBE ) ,minikube) image load $<
147148
148149image.tar : build
149- $(BUILDAH ) push localhost/postgres-operator oci-archive:$@ :localhost/postgres-operator:latest
150+ set -x && \
151+ case ' $(BUILDAH)' in \
152+ ' docker' ) docker image save ' --output=$@' ' $(IMAGE)' ;; \
153+ * ) $(BUILDAH ) push ' $(IMAGE)' ' oci-archive:$@:$(IMAGE)' ;; \
154+ esac
150155
151156# #@ Test
152157
0 commit comments