Merge branch '145-build-system-rewrite' of gitea.uniworx.systems:fraport/fradrive into 145-build-system-rewrite
This commit is contained in:
commit
1b447a330d
31
Makefile
31
Makefile
@ -24,15 +24,16 @@ export DEV_PORT_HTTPS
|
||||
###########################
|
||||
##### GENERAL TARGETS #####
|
||||
|
||||
.PHONY: --%
|
||||
|
||||
.PHONY: help
|
||||
# HELP: print out this help message
|
||||
help:
|
||||
@utils/makehelp.pl Makefile
|
||||
|
||||
.PHONY: all
|
||||
# HELP: unfinished
|
||||
all:
|
||||
@echo "TODO"
|
||||
@if [ -z "$$(which perl 2>/dev/null)" ] ; then \
|
||||
$(CONTAINER_COMMAND) run -v .:/mnt 'debian:12.5' '/mnt/utils/makehelp.pl' '/mnt/Makefile' ; \
|
||||
else \
|
||||
utils/makehelp.pl Makefile ; \
|
||||
fi
|
||||
|
||||
.PHONY: clean
|
||||
# HELP: remove all compilation results in the directory but leave containers and images unharmed
|
||||
@ -102,11 +103,9 @@ test: test-frontend test-backend i18n-check
|
||||
%-frontend: FRADRIVE_SERVICE=frontend
|
||||
%-frontend: --image-build --containerized---%-frontend;
|
||||
|
||||
.PHONY: --%-frontend
|
||||
--%-frontend: --containerized---frontend-dependencies-frontend;
|
||||
|
||||
# HELP(compile-frontend): compile frontend
|
||||
.PHONY: --compile-frontend
|
||||
--compile-frontend: --frontend-dependencies
|
||||
npx -- webpack --progress $(WATCH)
|
||||
|
||||
@ -116,23 +115,19 @@ serve-frontend: CONTAINER_INTERACTIVE=-it
|
||||
serve-frontend:
|
||||
$(MAKE) -- --containerized---compile-frontend WATCH=--watch
|
||||
|
||||
# .PHONY: --serve-frontend
|
||||
# --serve-frontend: WATCH=--watch
|
||||
# --serve-frontend: --compile-frontend;
|
||||
|
||||
# HELP(lint-frontend): lint frontend
|
||||
.PHONY: --lint-frontend
|
||||
--lint-frontend: eslint.config.js
|
||||
npx -- eslint frontend/src $(FIX)
|
||||
@echo Hooray! There are no hints.
|
||||
|
||||
# HELP(test-frontend): test frontend
|
||||
.PHONY: --test-frontend
|
||||
--test-frontend: karma.conf.cjs
|
||||
@echo Karma frontend tests are currently broken after npm update and have therefor been temporarily disabled.
|
||||
# npx -- karma start --conf karma.conf.cjs $(WATCH)
|
||||
|
||||
.PHONY: --frontend-dependencies
|
||||
--frontend-dependencies: node_modules package.json package-lock.json assets;
|
||||
|
||||
node_modules: package.json package-lock.json
|
||||
@ -166,12 +161,10 @@ well-known: node_modules assets
|
||||
%-prod-backend: FRADRIVE_SERVICE=backend
|
||||
%-prod-backend: --image-build --containerized---%-prod-backend;
|
||||
|
||||
.PHONY: --%-dev-backend
|
||||
--%-dev-backend: FRADRIVE_SERVICE=backend
|
||||
--%-dev-backend: stackopts=--flag uniworx:dev
|
||||
--%-dev-backend: --image-build --containerized---%-backend;
|
||||
|
||||
.PHONY: --%-prod-backend
|
||||
--%-prod-backend: FRADRIVE_SERVICE=backend
|
||||
--%-prod-backend: stackopts=--flag uniworx:-dev
|
||||
--%-prod-backend: --image-build --containerized-%-backend;
|
||||
@ -183,24 +176,20 @@ serve-backend:
|
||||
DEV_PORT_HTTP=`docker/backend/dev_port.pl 3000 | tee .dev-port-http`; \
|
||||
DEV_PORT_HTTPS=`docker/backend/dev_port.pl 3443 | tee .dev-port-https`; \
|
||||
$(MAKE) -- --containerized---serve-dev-backend DEV_PORT_HTTP=$${DEV_PORT_HTTP} DEV_PORT_HTTPS=$${DEV_PORT_HTTPS}
|
||||
.PHONY: --serve-dev-backend
|
||||
--serve-dev-backend: start.sh
|
||||
DEV_PORT_HTTP=`cat .dev-port-http`; \
|
||||
DEV_PORT_HTTPS=`cat .dev-port-https`; \
|
||||
./start.sh
|
||||
|
||||
# HELP(compile-backend): compile backend
|
||||
.PHONY: --compile-backend
|
||||
--compile-backend:
|
||||
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --local-bin-path $$(pwd)/bin $(stackopts)
|
||||
|
||||
# HELP(lint-backend): lint backend
|
||||
.PHONY: --lint-backend
|
||||
--lint-backend:
|
||||
stack build --test --fast --flag uniworx:library-only uniworx:test:hlint $(stackopts)
|
||||
|
||||
# HELP(test-backend): test backend
|
||||
.PHONY: --test-backend
|
||||
--test-backend:
|
||||
stack build --test --coverage --fast --flag uniworx:library-only $(stackopts)
|
||||
|
||||
@ -213,7 +202,6 @@ serve-backend:
|
||||
.stack: stack.yaml stack.yaml.lock
|
||||
.stack:
|
||||
$(MAKE) -- --image-run---.stack
|
||||
.PHONY: --.stack
|
||||
--.stack: stack.yaml stack.yaml.lock
|
||||
stack build --fast --only-dependencies $(stackopts)
|
||||
|
||||
@ -233,7 +221,6 @@ serve-backend:
|
||||
serve-database: CONTAINER_INTERACTIVE=-it
|
||||
serve-database: --containerized-database;
|
||||
|
||||
.PHONY: --containerized-database
|
||||
--containerized-database: FRADRIVE_SERVICE=database
|
||||
# port forwarding is disabled in --network=host mode; nevertheless it is stated here for documentation reasons
|
||||
# --containerized-database: CONTAINER_PORTS=--network=host -p 5432:5432/tcp
|
||||
@ -255,7 +242,6 @@ serve-database: --containerized-database;
|
||||
--containerized-%-frontend: --image-build
|
||||
$(MAKE) -- --image-run-$*-frontend
|
||||
|
||||
.PHONY: --containerized-%-backend
|
||||
--containerized-%-backend: FRADRIVE_SERVICE=backend
|
||||
#--containerized-%-backend: --image-build --image-run-%-backend;
|
||||
# --containerized-%-backend: CONTAINER_PORTS=--network=host -p $(DEV_PORT_HTTP):3000 -p $(DEV_PORT_HTTPS):3443
|
||||
@ -266,7 +252,6 @@ serve-database: --containerized-database;
|
||||
# HELP: rebuild the stated docker image (frontend, backend, database instead of %)
|
||||
image-rebuild-%:
|
||||
$(MAKE) -- --image-build FRADRIVE_SERVICE=$* NO_CACHE=--no-cache
|
||||
.PHONY: --image-build
|
||||
--image-build:
|
||||
rm -f .Dockerfile
|
||||
ln -s docker/$(FRADRIVE_SERVICE)/Dockerfile .Dockerfile
|
||||
@ -279,7 +264,6 @@ image-rebuild-%:
|
||||
$(CONTAINER_COMMAND) build $(NO_CACHE) -v $(PWD):$${MOUNT_DIR} --env IN_CONTAINER=true --build-arg MOUNT_DIR=$${MOUNT_DIR} --build-arg PROJECT_DIR=$${PROJECT_DIR} --tag fradrive/$(FRADRIVE_SERVICE) --file $(PWD)/.Dockerfile ; \
|
||||
fi
|
||||
|
||||
.PHONY: --image-run-%
|
||||
--image-run-%:
|
||||
MOUNT_DIR=/mnt/fradrive; \
|
||||
if [ "$(IN_CONTAINER)" == "true" ] ; then \
|
||||
@ -295,7 +279,6 @@ image-rebuild-%:
|
||||
.PHONY: i18n-check
|
||||
# HELP: check internationalization
|
||||
i18n-check: --image-run---i18n-check
|
||||
.PHONY: --i18n-check
|
||||
--i18n-check:
|
||||
./missing-translations.sh
|
||||
@echo No missing translations.
|
||||
|
||||
Reference in New Issue
Block a user