diff --git a/Makefile b/Makefile index 2a2f62c123d..0313f5b0718 100644 --- a/Makefile +++ b/Makefile @@ -180,6 +180,45 @@ clean: client: generate $(GOIMPORTS) hack/build-client.sh "${AUTOREST_IMAGE}" 2020-04-30 2021-09-01-preview 2022-04-01 2022-09-04 2023-04-01 2023-07-01-preview 2023-09-04 2023-11-22 2024-08-12-preview +.PHONY: ci-rp +ci-rp: fix-macos-vendor + podman $(PODMAN_REMOTE_ARGS) \ + build . \ + -f Dockerfile.ci-rp \ + --ulimit=nofile=4096:4096 \ + --build-arg REGISTRY=$(REGISTRY) \ + --build-arg ARO_VERSION=$(VERSION) \ + --no-cache=$(NO_CACHE) \ + -t $(LOCAL_ARO_RP_IMAGE):$(VERSION) + + # Tag the portal build image if it exists + @PORTAL_IMAGE_ID=$(shell podman $(PODMAN_REMOTE_ARGS) image ls --filter label=stage=portal-build-cache-layer --noheading --format "{{.Id}}" | tail -n 1); \ + if [ -n "$$PORTAL_IMAGE_ID" ]; then \ + echo "Tagging Portal Image $$PORTAL_IMAGE_ID as $(LOCAL_ARO_PORTAL_BUILD_IMAGE):$(VERSION)"; \ + podman $(PODMAN_REMOTE_ARGS) tag $$PORTAL_IMAGE_ID $(LOCAL_ARO_PORTAL_BUILD_IMAGE):$(VERSION); \ + else \ + echo "No Portal Image found with label stage=portal-build-cache-layer"; \ + fi + + # Tag the RP build image if it exists + @RP_IMAGE_ID=$(shell podman $(PODMAN_REMOTE_ARGS) image ls --filter label=stage=rp-build-cache-layer --noheading --format "{{.Id}}" | tail -n 1); \ + if [ -n "$$RP_IMAGE_ID" ]; then \ + echo "Tagging RP Image $$RP_IMAGE_ID as $(LOCAL_ARO_RP_BUILD_IMAGE):$(VERSION)"; \ + podman $(PODMAN_REMOTE_ARGS) tag $$RP_IMAGE_ID $(LOCAL_ARO_RP_BUILD_IMAGE):$(VERSION); \ + else \ + echo "No RP Image found with label stage=rp-build-cache-layer"; \ + fi + + +.PHONY: ci-tunnel +ci-tunnel: fix-macos-vendor + podman build . -f Dockerfile.ci-tunnel --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --no-cache=$(NO_CACHE) -t aro-tunnel:$(VERSION) + +.PHONY: ci-clean +ci-clean: + $(shell podman ps --external --format "{{.Command}} {{.ID}}" | grep buildah | cut -d " " -f 2 | xargs podman rm -f > /dev/null) + podman image prune --all --filter="label=aro-*=true" + # TODO: hard coding dev-config.yaml is clunky; it is also probably convenient to # override COMMIT. .PHONY: deploy