From e5e7612e9b4ff0ffb37870b0f3d4dd3a540e0d23 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 25 Mar 2025 15:44:00 +0100 Subject: [PATCH] build(Makefile): Clean containers on clean-all --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b71b7ef31..939bf1b8e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ export SHELL=bash export CLEAN_DEPENDENCIES ?= false +export CLEAN_IMAGES ?= false .PHONY: help # HELP: print out this help message @@ -9,10 +10,13 @@ help: .PHONY: clean # HELP: clean compilation caches -clean: clean-frontend clean-backend ; +clean: + $(MAKE) clean-frontend CLEAN_DEPENDENCIES=$(CLEAN_DEPENDENCIES) CLEAN_IMAGES=$(CLEAN_IMAGES) + $(MAKE) clean-backend CLEAN_DEPENDENCIES=$(CLEAN_DEPENDENCIES) CLEAN_IMAGES=$(CLEAN_IMAGES) .PHONY: clean-all # HELP: clean everything, including dependency and image caches clean-all: CLEAN_DEPENDENCIES = true +clean-all: CLEAN_IMAGES = true clean-all: clean ; .PHONY: clean-% @@ -25,6 +29,10 @@ ifeq ("$(CLEAN_DEPENDENCIES)", "true") @$(MAKE) -- --clean-$*-deps @echo "Cleaned $* dependencies." endif +ifeq ("$(CLEAN_IMAGES)", "true") + docker compose rm --force --volumes + @echo "Cleaned $* image." +endif --clean-frontend: -rm -rf assets/icons assets/favicons -rm -rf static well-known