Compare commits

...

6 Commits

5 changed files with 14 additions and 69 deletions

View File

@ -7,9 +7,8 @@ export CONTAINER_RUN ?= $(CONTAINER_COMMAND) run -dit --network=host
export IN_CONTAINER ?= false
export IN_CI ?= false
# TODO: deprecated
export WATCH
export db ?= -cf
export UNIWORXDB_OPTS ?= -cf
export CONTAINER_ID
export FRADRIVE_SERVICE
@ -17,6 +16,7 @@ export FRADRIVE_SERVICE
# TODO: to be deprecated
export DEV_PORT_HTTP
export DEV_PORT_HTTPS
export HOOGLE_PORT
export IMAGE_REGISTRY = docker.io
export MEMCACHED_IMAGE = $(IMAGE_REGISTRY)/memcached:latest
@ -173,6 +173,7 @@ well-known: static;
##### BACKEND TARGETS #####
.PHONY: %-backend
%-backend: FRADRIVE_SERVICE=backend
%-backend: --image-build --containerized---%-backend;
# TODO: to be deprecated by start-%
@ -203,12 +204,16 @@ serve-backend:
--test-backend:
stack build --test --coverage --fast --workdir .stack-work-test --flag uniworx:library-only $(stackopts)
# TODO: better name
.PHONY: db
db: FRADRIVE_SERVICE=backend
db: --image-build --containerized---db;
# HELP(db-cf-backend): clear and fill database. requires running postgres
# TODO (db-m-$MIGRATION-backend): apply migration (see src/Model/Migration/Definition.hs for list of available migrations)
--db-%-dev-backend: .stack
--db-backend: .stack
SERVER_SESSION_ACID_FALLBACK=${SERVER_SESSION_ACID_FALLBACK:-true} ; \
AVSPASS=${AVSPASS:-nopasswordset} ; \
stack exec uniworxdb -- -$*
stack exec uniworxdb -- $(UNIWORXDB_OPTS)
.stack: stack.yaml stack.yaml.lock package.yaml
.stack:
@ -250,6 +255,7 @@ serve-database: --containerized-database;
--containerized-%-backend: --image-build
$(MAKE) -- --image-run-$*-backend
--containerized-%-hoogle: --containerized-%-hoogle-backend;
--containerized---db: --containerized-db-backend;
# --containerized-%-minio: FRADRIVE_SERVICE=minio
# --containerized-%-minio: --image-build
@ -353,7 +359,7 @@ start-backend: BASE_PORTS = "DEV_PORT_HTTP=3000" "DEV_PORT_HTTPS=3443"
start-backend: SINGLETON = false
start-backend: static
start-hoogle: BASE_PORT = "HOOGLE_PORT=8081"
start-hoogle: BASE_PORTS = "HOOGLE_PORT=8081"
start-hoogle: SINGLETON=true
start-frontend: SINGLETON = false
@ -422,7 +428,7 @@ log-%:
# TODO: move targets below to better location
# Some convenience aliases:
hoogle: start-hoogle
hoogle: start-hoogle;
.PHONY: i18n-check
# HELP: check internationalization

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
set -e
# 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
__HOST=${HOST:-$(hostname -s | awk '{ print $0; }')}
export DETAILED_LOGGING=${DETAILED_LOGGING:-true}
export LOG_ALL=${LOG_ALL:-false}
export LOGLEVEL=${LOGLEVEL:-info}
export DUMMY_LOGIN=${DUMMY_LOGIN:-true}
export SERVER_SESSION_ACID_FALLBACK=${SERVER_SESSION_ACID_FALLBACK:-true}
export SERVER_SESSION_COOKIES_SECURE=${SERVER_SESSION_COOKIES_SECURE:-false}
export COOKIES_SECURE=${COOKIES_SECURE:-false}
export ALLOW_DEPRECATED=${ALLOW_DEPRECATED:-true}
export ENCRYPT_ERRORS=${ENCRYPT_ERRORS:-false}
export RIBBON=${RIBBON:-${__HOST:-localhost}}
export APPROOT=${APPROOT:-http://localhost:$DEV_PORT_HTTP}
export AVSPASS=${AVSPASS:-nopasswordset}
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
# }
# if [[ -d .stack-work-run ]]; then
# [[ -d .stack-work ]] && mv -vT .stack-work .stack-work-build
# mv -vT .stack-work-run .stack-work
# trap move-back EXIT
# fi
if ! [ -z "$(which yesod)" ]
then
yesod devel -p "$DEV_PORT_HTTP" -q "$DEV_PORT_HTTPS" $@
elif ! [ -z "$(which stack)" ]
then
stack exec -- yesod devel -p "$DEV_PORT_HTTP" -q "$DEV_PORT_HTTPS" $@
else
exit 1
fi

View File

@ -6,17 +6,4 @@ set -e
#
# SPDX-License-Identifier: AGPL-3.0-or-later
[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || :
move-back() {
mv -vT .stack-work .stack-work-doc
[[ -d .stack-work-build ]] && mv -vT .stack-work-build .stack-work
}
if [[ -d .stack-work-doc ]]; then
[[ -d .stack-work ]] && mv -vT .stack-work .stack-work-build
mv -vT .stack-work-doc .stack-work
trap move-back EXIT
fi
stack hoogle -- ${@:-server --local --work-dir .stack-work-doc --port $HOOGLE_PORT}
stack --work-dir .stack-work-doc --jobs 4 hoogle -- ${@:-server --local --port $HOOGLE_PORT}

View File

@ -38,7 +38,7 @@ unset HOST
if ! [ -z "$(which stack)" ]
then
stack --work-dir .stack-work-run exec -- yesod devel -p "$DEV_PORT_HTTP" -q "$DEV_PORT_HTTPS" $@
stack --jobs 4 --work-dir .stack-work-run exec -- yesod devel -p "$DEV_PORT_HTTP" -q "$DEV_PORT_HTTPS" $@
else
exit 1
fi

View File

@ -20,7 +20,6 @@ $STARTSCRIPT
while [ -e "$FILENAME" ] ; do
sleep 1
if ! $RUNNER ps --no-trunc | grep -q "$CONTAINER_ID" ; then
$RUNNER ps | grep "$CONTAINER_ID"
rm "$FILENAME"
exit
fi