33#
44# SPDX-License-Identifier: CC0-1.0
55
6- .PHONY : all build build-tools crds-rs generate manifests cluster-up cluster-down image push install-trustee install clean fmt-check clippy lint test test-release release-tarball
6+ .PHONY : all build build-tools crds-rs generate manifests cluster-up cluster-down \
7+ install-trustee install clean fmt-check clippy lint test test-release release-tarball \
8+ operator-image compute-pcrs-image reg-server-image attestation-key-register-image image \
9+ push-operator push-compute-pcrs push-reg-server push-attestation-key-register push \
710
811SHELL := /bin/bash
912
@@ -24,6 +27,7 @@ KOPIUM ?= $(LOCALBIN)/kopium-$(KOPIUM_VERSION)
2427REGISTRY ?= quay.io/trusted-execution-clusters
2528TAG ?= latest
2629PUSH_FLAGS ?=
30+ DELETE_AFTER_PUSH ?= false
2731OPERATOR_IMAGE ?= $(REGISTRY ) /trusted-cluster-operator:$(TAG )
2832COMPUTE_PCRS_IMAGE =$(REGISTRY ) /compute-pcrs:$(TAG )
2933REG_SERVER_IMAGE =$(REGISTRY ) /registration-server:$(TAG )
@@ -113,11 +117,21 @@ attestation-key-register-image:
113117
114118image : operator-image compute-pcrs-image reg-server-image attestation-key-register-image
115119
116- push : image
117- $(CONTAINER_CLI ) push $(OPERATOR_IMAGE ) $(PUSH_FLAGS )
118- $(CONTAINER_CLI ) push $(COMPUTE_PCRS_IMAGE ) $(PUSH_FLAGS )
119- $(CONTAINER_CLI ) push $(REG_SERVER_IMAGE ) $(PUSH_FLAGS )
120- $(CONTAINER_CLI ) push $(ATTESTATION_KEY_REGISTER_IMAGE ) $(PUSH_FLAGS )
120+ define push-image
121+ $(CONTAINER_CLI ) push $(1 ) $(PUSH_FLAGS )
122+ $(if $(filter true,$(DELETE_AFTER_PUSH ) ) ,$(CONTAINER_CLI ) rmi $(1 ) )
123+ endef
124+
125+ push-operator : operator-image
126+ $(call push-image,$(OPERATOR_IMAGE ) )
127+ push-compute-pcrs : compute-pcrs-image
128+ $(call push-image,$(COMPUTE_PCRS_IMAGE ) )
129+ push-reg-server : reg-server-image
130+ $(call push-image,$(REG_SERVER_IMAGE ) )
131+ push-attestation-key-register : attestation-key-register-image
132+ $(call push-image,$(ATTESTATION_KEY_REGISTER_IMAGE ) )
133+
134+ push : push-operator push-compute-pcrs push-reg-server push-attestation-key-register
121135
122136release-tarball : manifests
123137 tar -cf trusted-execution-operator-$(TAG ) .tar config
0 commit comments