fradrive/Makefile
Sarah Vaupel 72f5a9fb37 build: move backend-related files into backend dir; implement and connect services via docker-compose
TODOs left: reimplement clean and help, sync static,well-known and assets between services
2025-03-23 04:52:49 +01:00

82 lines
2.3 KiB
Makefile

export SHELL=bash
.PHONY: help
# HELP: print out this help message
help:
@if [ -z "$$(which perl 2>/dev/null)" ] ; then \
$(CONTAINER_FGRUN) .:/mnt 'debian:12.5' '/mnt/utils/makehelp.pl' '/mnt/Makefile' ; \
else \
utils/makehelp.pl Makefile ; \
fi
.PHONY: clean
# HELP: stop all running containers and remove all compilation results in the directory (but leave images including dependencies unharmed)
clean:
-rm -rf frontend/node_modules .npm .cache frontend/assets/icons frontend/assets/favicons frontend/static well-known config/manifest.json frontend/src/env.sass
-rm -rf .stack-work .stack-work.lock
-rm -rf bin .Dockerfile develop
-$(CONTAINER_COMMAND) container prune --force
.PHONY: clean-images
# HELP: stop all running containers and clean all images from local repositories
clean-images:
rm -rf develop
sleep 5
-$(CONTAINER_COMMAND) system prune --all --force --volumes
-$(CONTAINER_COMMAND) image prune --all --force
-$(CONTAINER_COMMAND) volume prune --force
.PHONY: clean-all
# HELP: like clean but with full container, image, and volume prune
clean-all: clean
-rm -rf .stack
$(CONTAINER_COMMAND) system reset --force
.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