From d7ef69e85480426152635f9981473dd72aa6f819 Mon Sep 17 00:00:00 2001 From: Daniel Fox Date: Tue, 12 Nov 2024 10:30:09 -0800 Subject: [PATCH] Add release-build and release-publish targets --- key-cert-provisioner/Makefile | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/key-cert-provisioner/Makefile b/key-cert-provisioner/Makefile index 35846f4df44..acb52891c9c 100644 --- a/key-cert-provisioner/Makefile +++ b/key-cert-provisioner/Makefile @@ -55,11 +55,9 @@ $(BINDIR)/test-signer-$(ARCH): # BUILD IMAGE ############################################################################### .PHONY: image-all -image-all: $(addprefix sub-image-,$(VALIDARCHES)) sub-image-fips-amd64 +image-all: $(addprefix sub-image-,$(VALIDARCHES)) sub-image-%: $(MAKE) image ARCH=$* -sub-image-fips-%: - $(MAKE) image FIPS=true ARCH=$* SIGNER_CREATED=.signer.created-$(ARCH) @@ -93,3 +91,26 @@ clean: -docker image rm -f $$(docker images $(KEY_CERT_PROVISIONER_IMAGE) -a -q) -docker image rm -f $$(docker images $(TEST_SIGNER_IMAGE) -a -q) +############################################################################### +# Release +############################################################################### +## Produces a clean build of release artifacts at the specified version. +release-build: .release-$(VERSION).created +.release-$(VERSION).created: + $(MAKE) clean image-all RELEASE=true + $(MAKE) retag-build-images-with-registries IMAGETAG=$(VERSION) RELEASE=true + # Generate the `latest` images. + $(MAKE) retag-build-images-with-registries IMAGETAG=latest RELEASE=true + touch $@ + +## Pushes a github release and release artifacts produced by `make release-build`. +release-publish: release-prereqs .release-$(VERSION).published +.release-$(VERSION).published: + $(MAKE) push-images-to-registries push-manifests IMAGETAG=$(VERSION) RELEASE=$(RELEASE) CONFIRM=$(CONFIRM) + touch $@ + +## Pushes a github release and release artifacts produced by `make release-build`. +release-publish: release-prereqs .release-ksp-$(VERSION).published +.release-ksp-$(VERSION).published: + $(MAKE) push-images-to-registries push-manifests IMAGETAG=$(VERSION) RELEASE=$(RELEASE) CONFIRM=$(CONFIRM) + touch $@