build(Makefile): work on start targets
This commit is contained in:
parent
faf4cc8c03
commit
277ae187f5
16
Makefile
16
Makefile
@ -41,6 +41,9 @@ release:
|
|||||||
############################################
|
############################################
|
||||||
##### UNIFIED FRONTEND/BACKEND TARGETS #####
|
##### UNIFIED FRONTEND/BACKEND TARGETS #####
|
||||||
|
|
||||||
|
.PHONY: serve
|
||||||
|
serve: serve-frontend serve-backend
|
||||||
|
|
||||||
.PHONY: compile
|
.PHONY: compile
|
||||||
compile: compile-frontend compile-backend
|
compile: compile-frontend compile-backend
|
||||||
|
|
||||||
@ -68,9 +71,9 @@ test: test-frontend test-backend i18n-check
|
|||||||
--compile-frontend:
|
--compile-frontend:
|
||||||
npx -- webpack --progress $(WATCH)
|
npx -- webpack --progress $(WATCH)
|
||||||
|
|
||||||
.PHONY: --frontend-watch
|
.PHONY: --serve-frontend
|
||||||
--frontend-watch: WATCH=--watch
|
--serve-frontend: WATCH=--watch
|
||||||
--frontend-watch: --compile-frontend;
|
--serve-frontend: --compile-frontend;
|
||||||
|
|
||||||
.PHONY: --lint-frontend
|
.PHONY: --lint-frontend
|
||||||
--lint-frontend: eslint.config.js
|
--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.
|
@echo Karma frontend tests are currently broken after npm update and have therefor been temporarily disabled.
|
||||||
# npx -- karma start --conf karma.conf.cjs $(WATCH)
|
# npx -- karma start --conf karma.conf.cjs $(WATCH)
|
||||||
|
|
||||||
|
# TODO: rewrite
|
||||||
.PHONY: --test-frontend-watch
|
.PHONY: --test-frontend-watch
|
||||||
--test-frontend-watch: WATCH=--single-run false
|
--test-frontend-watch: WATCH=--single-run false
|
||||||
--test-frontend-watch: --test-frontend;
|
--test-frontend-watch: --test-frontend;
|
||||||
@ -136,11 +140,15 @@ well-known/.well-known:
|
|||||||
--%-backend-dev: stackopts=--flag uniworx:dev
|
--%-backend-dev: stackopts=--flag uniworx:dev
|
||||||
--%-backend-dev: --image-build --%-backend;
|
--%-backend-dev: --image-build --%-backend;
|
||||||
|
|
||||||
.PHONY: --backend-%-prod
|
.PHONY: --%-backend-prod
|
||||||
--%-backend-prod: FRADRIVE_SERVICE=backend
|
--%-backend-prod: FRADRIVE_SERVICE=backend
|
||||||
--%-backend-prod: stackopts=--flag uniworx:-dev
|
--%-backend-prod: stackopts=--flag uniworx:-dev
|
||||||
--%-backend-prod: --image-build --%-backend;
|
--%-backend-prod: --image-build --%-backend;
|
||||||
|
|
||||||
|
.PHONY: --serve-backend
|
||||||
|
--serve-backend: .stack-work.lock
|
||||||
|
./start.sh
|
||||||
|
|
||||||
.PHONY: --compile-backend
|
.PHONY: --compile-backend
|
||||||
--compile-backend:
|
--compile-backend:
|
||||||
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --copy-bins --local-bin-path $$(pwd)/bin $(stackopts)
|
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --copy-bins --local-bin-path $$(pwd)/bin $(stackopts)
|
||||||
|
|||||||
@ -21,4 +21,7 @@ ENV STACK_ROOT=/.stack
|
|||||||
RUN make .stack STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true
|
RUN make .stack STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true
|
||||||
|
|
||||||
ENV FRADRIVE_MAKE_TARGET=backend-build
|
ENV FRADRIVE_MAKE_TARGET=backend-build
|
||||||
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true
|
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true
|
||||||
|
|
||||||
|
# export full develop port range
|
||||||
|
EXPOSE TODO/tcp
|
||||||
14
start.sh
14
start.sh
@ -2,18 +2,11 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>
|
# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>, Sarah Vaupel <vaupel.sarah@campus.lmu.de>, Steffen Jost <jost@tcs.ifi.lmu.de>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# 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; }')}
|
__HOST=${HOST:-$(hostname -s | awk '{ print $0; }')}
|
||||||
|
|
||||||
export DETAILED_LOGGING=${DETAILED_LOGGING:-true}
|
export DETAILED_LOGGING=${DETAILED_LOGGING:-true}
|
||||||
@ -28,11 +21,10 @@ export ENCRYPT_ERRORS=${ENCRYPT_ERRORS:-false}
|
|||||||
export RIBBON=${RIBBON:-${__HOST:-localhost}}
|
export RIBBON=${RIBBON:-${__HOST:-localhost}}
|
||||||
export APPROOT=${APPROOT:-http://localhost:$((${PORT_OFFSET:-0} + 3000))}
|
export APPROOT=${APPROOT:-http://localhost:$((${PORT_OFFSET:-0} + 3000))}
|
||||||
export AVSPASS=${AVSPASS:-nopasswordset}
|
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
|
unset HOST
|
||||||
|
|
||||||
|
export PORT_OFFSET=$(((16#$(sha256sum <<<"$(hostname -f):''${basePath}" | head -c 16)) % 1000))
|
||||||
|
|
||||||
move-back() {
|
move-back() {
|
||||||
mv -vT .stack-work .stack-work-run
|
mv -vT .stack-work .stack-work-run
|
||||||
[[ -d .stack-work-build ]] && mv -vT .stack-work-build .stack-work
|
[[ -d .stack-work-build ]] && mv -vT .stack-work-build .stack-work
|
||||||
|
|||||||
Reference in New Issue
Block a user