build(Makefile): Clean containers on clean-all
This commit is contained in:
parent
ebf71b7135
commit
e5e7612e9b
10
Makefile
10
Makefile
@ -1,6 +1,7 @@
|
|||||||
export SHELL=bash
|
export SHELL=bash
|
||||||
|
|
||||||
export CLEAN_DEPENDENCIES ?= false
|
export CLEAN_DEPENDENCIES ?= false
|
||||||
|
export CLEAN_IMAGES ?= false
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
# HELP: print out this help message
|
# HELP: print out this help message
|
||||||
@ -9,10 +10,13 @@ help:
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
# HELP: clean compilation caches
|
# 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
|
.PHONY: clean-all
|
||||||
# HELP: clean everything, including dependency and image caches
|
# HELP: clean everything, including dependency and image caches
|
||||||
clean-all: CLEAN_DEPENDENCIES = true
|
clean-all: CLEAN_DEPENDENCIES = true
|
||||||
|
clean-all: CLEAN_IMAGES = true
|
||||||
clean-all: clean ;
|
clean-all: clean ;
|
||||||
|
|
||||||
.PHONY: clean-%
|
.PHONY: clean-%
|
||||||
@ -25,6 +29,10 @@ ifeq ("$(CLEAN_DEPENDENCIES)", "true")
|
|||||||
@$(MAKE) -- --clean-$*-deps
|
@$(MAKE) -- --clean-$*-deps
|
||||||
@echo "Cleaned $* dependencies."
|
@echo "Cleaned $* dependencies."
|
||||||
endif
|
endif
|
||||||
|
ifeq ("$(CLEAN_IMAGES)", "true")
|
||||||
|
docker compose rm --force --volumes
|
||||||
|
@echo "Cleaned $* image."
|
||||||
|
endif
|
||||||
--clean-frontend:
|
--clean-frontend:
|
||||||
-rm -rf assets/icons assets/favicons
|
-rm -rf assets/icons assets/favicons
|
||||||
-rm -rf static well-known
|
-rm -rf static well-known
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user