fradrive/Makefile

90 lines
2.1 KiB
Makefile

export SHELL=bash
export CLEAN_DEPENDENCIES ?= false
.PHONY: help
# HELP: print out this help message
help:
docker compose run help
.PHONY: clean
# HELP: clean compilation caches
clean: clean-frontend clean-backend ;
.PHONY: clean-all
# HELP: clean everything, including dependency and image caches
clean-all: CLEAN_DEPENDENCIES = true
clean-all: clean ;
.PHONY: clean-%
# HELP(clean-$SERVICE): invalidate caches for a given service. Supported services: frontend, backend.
clean-%:
$(MAKE) stop-$*
@$(MAKE) -- --clean-$*
@echo "Cleaned $* build files and binaries."
ifeq ("$(CLEAN_DEPENDENCIES)", "true")
@$(MAKE) -- --clean-$*-deps
@echo "Cleaned $* dependencies."
endif
--clean-frontend:
-rm -rf assets/icons assets/favicons
-rm -rf static well-known
--clean-frontend-deps:
-rm -rf frontend/node_modules
-rm -rf frontend/.npm
--clean-backend:
-rm -rf backend/.stack-work
-rm -rf bin/
--clean-backend-deps:
-rf -rf backend/.stack
.PHONY: release
# HELP: create, commit and push a new release
# TODO: only release when build and tests are passing!!!
release:
VERSION=`./utils/version.pl -changelog CHANGELOG.md -v` ; \
git add CHANGELOG.md ; \
git commit -m "chore(release): $${VERSION}" ; \
git push ; \
git tag $${VERSION} ; \
git push origin $${VERSION}
.PHONY: compile
# HELP: perform full compilation (frontend and backend)
compile: compile-frontend compile-backend ;
.PHONY: compile-%
compile-%:
docker compose run --remove-orphans --build --no-deps $* make compile
.PHONY: start
# HELP: start complete development environment with a fresh test database
start: start-postgres start-maildev start-memcached start-minio start-backend
docker compose run backend make start
.PHONY: start-%
start-%:
docker compose up -d --build $*
.PHONY: stop
stop:
docker compose down
.PHONY: stop-%
stop-%:
docker compose down $*
.PHONY: kill-%
kill-%:
docker compose kill $*
.PHONY: status
status:
docker compose ps
.PHONY: top
top:
docker compose stats
.PHONY: log-%
log-%:
docker compose logs --follow --timestamps $*
.PHONY: --%
.SUFFIXES: # Delete all default suffixes