diff --git a/Makefile b/Makefile index 0af44ab52..b10d41c77 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,9 @@ release: ############################################ ##### UNIFIED FRONTEND/BACKEND TARGETS ##### +.PHONY: serve +serve: serve-frontend serve-backend + .PHONY: compile compile: compile-frontend compile-backend @@ -68,9 +71,9 @@ test: test-frontend test-backend i18n-check --compile-frontend: npx -- webpack --progress $(WATCH) -.PHONY: --frontend-watch ---frontend-watch: WATCH=--watch ---frontend-watch: --compile-frontend; +.PHONY: --serve-frontend +--serve-frontend: WATCH=--watch +--serve-frontend: --compile-frontend; .PHONY: --lint-frontend --lint-frontend: eslint.config.js @@ -82,6 +85,7 @@ test: test-frontend test-backend i18n-check @echo Karma frontend tests are currently broken after npm update and have therefor been temporarily disabled. # npx -- karma start --conf karma.conf.cjs $(WATCH) +# TODO: rewrite .PHONY: --test-frontend-watch --test-frontend-watch: WATCH=--single-run false --test-frontend-watch: --test-frontend; @@ -136,11 +140,15 @@ well-known/.well-known: --%-backend-dev: stackopts=--flag uniworx:dev --%-backend-dev: --image-build --%-backend; -.PHONY: --backend-%-prod +.PHONY: --%-backend-prod --%-backend-prod: FRADRIVE_SERVICE=backend --%-backend-prod: stackopts=--flag uniworx:-dev --%-backend-prod: --image-build --%-backend; +.PHONY: --serve-backend +--serve-backend: .stack-work.lock + ./start.sh + .PHONY: --compile-backend --compile-backend: stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --copy-bins --local-bin-path $$(pwd)/bin $(stackopts) diff --git a/docker/backend/Dockerfile b/docker/backend/Dockerfile index 098bfdfa5..ff7b51db1 100644 --- a/docker/backend/Dockerfile +++ b/docker/backend/Dockerfile @@ -21,4 +21,7 @@ ENV STACK_ROOT=/.stack RUN make .stack STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true ENV FRADRIVE_MAKE_TARGET=backend-build -ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true \ No newline at end of file +ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true + +# export full develop port range +EXPOSE TODO/tcp \ No newline at end of file diff --git a/start.sh b/start.sh index fb7492ae7..e69a976b4 100755 --- a/start.sh +++ b/start.sh @@ -2,18 +2,11 @@ set -e -# SPDX-FileCopyrightText: 2022 Gregor Kleen ,Sarah Vaupel ,Steffen Jost +# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel , Gregor Kleen , Sarah Vaupel , Steffen Jost # # SPDX-License-Identifier: AGPL-3.0-or-later -[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || : - -if ! in-develop | grep -q 'In develop'; then - printf "Not in develop" - exit 1 -fi - __HOST=${HOST:-$(hostname -s | awk '{ print $0; }')} export DETAILED_LOGGING=${DETAILED_LOGGING:-true} @@ -28,11 +21,10 @@ export ENCRYPT_ERRORS=${ENCRYPT_ERRORS:-false} export RIBBON=${RIBBON:-${__HOST:-localhost}} export APPROOT=${APPROOT:-http://localhost:$((${PORT_OFFSET:-0} + 3000))} export AVSPASS=${AVSPASS:-nopasswordset} -export PATH=${PATH:/home/jost/projects/fradrive} -export MAIL_REROUTE_TO_NAME='Steffen Jost' -export MAIL_REROUTE_TO_EMAIL=jost@tcs.ifi.lmu.de unset HOST +export PORT_OFFSET=$(((16#$(sha256sum <<<"$(hostname -f):''${basePath}" | head -c 16)) % 1000)) + move-back() { mv -vT .stack-work .stack-work-run [[ -d .stack-work-build ]] && mv -vT .stack-work-build .stack-work