|
1 | 1 |
|
| 2 | +IMAGE ?= localhost/postgres-operator:latest |
2 | 3 | PGMONITOR_DIR ?= hack/tools/pgmonitor
|
3 | 4 | PGMONITOR_VERSION ?= v5.2.1
|
4 | 5 | QUERIES_CONFIG_DIR ?= hack/tools/queries
|
@@ -44,7 +45,7 @@ notes: ## List known issues and future considerations
|
44 | 45 | .PHONY: clean
|
45 | 46 | clean: ## Clean resources
|
46 | 47 | clean: clean-deprecated
|
47 |
| - rm -f bin/postgres-operator |
| 48 | + rm -f bin/postgres-operator image.tar |
48 | 49 | rm -rf licenses/*/
|
49 | 50 | [ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
|
50 | 51 | [ ! -d hack/tools/envtest ] || { chmod -R u+w hack/tools/envtest && rm -r hack/tools/envtest; }
|
@@ -133,14 +134,25 @@ deploy-dev: createnamespaces
|
133 | 134 |
|
134 | 135 | .PHONY: build
|
135 | 136 | build: ## Build a postgres-operator image
|
136 |
| - $(BUILDAH) build --tag localhost/postgres-operator \ |
| 137 | + $(BUILDAH) build --tag '$(IMAGE)' \ |
137 | 138 | --label org.opencontainers.image.authors='Crunchy Data' \
|
138 | 139 | --label org.opencontainers.image.description='Crunchy PostgreSQL Operator' \
|
139 | 140 | --label org.opencontainers.image.revision='$(shell git rev-parse HEAD)' \
|
140 | 141 | --label org.opencontainers.image.source='https://github.com/CrunchyData/postgres-operator' \
|
141 | 142 | --label org.opencontainers.image.title='Crunchy PostgreSQL Operator' \
|
142 | 143 | .
|
143 | 144 |
|
| 145 | +build-k3d: image.tar ; $(or $(K3D),k3d) image import $< |
| 146 | +build-kind: image.tar ; $(or $(KIND),kind) load image-archive $< |
| 147 | +build-minikube: image.tar ; $(or $(MINIKUBE),minikube) image load $< |
| 148 | + |
| 149 | +image.tar: build |
| 150 | + set -x && \ |
| 151 | + case '$(BUILDAH)' in \ |
| 152 | + *docker*) $(BUILDAH) image save '--output=$@' '$(IMAGE)' ;; \ |
| 153 | + *) $(BUILDAH) push '$(IMAGE)' 'oci-archive:$@:$(IMAGE)' ;; \ |
| 154 | + esac |
| 155 | + |
144 | 156 | ##@ Test
|
145 | 157 |
|
146 | 158 | .PHONY: check
|
|
0 commit comments