Skip to content

Commit

Permalink
Fix make ci-clean and runlocal-rp (#3806)
Browse files Browse the repository at this point in the history
* Fix make ci-clean error for running work containers by buildah that prevents prune from working
* Fix make runlocal-rp image syntax
  • Loading branch information
SudoBrendan authored and edisonLcardenas committed Sep 17, 2024
1 parent 0c7727b commit 16daadc
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16daadc

Please sign in to comment.