chore(Makefile): first stub of some scripts migrated

This commit is contained in:
Sarah Vaupel 2024-01-14 05:33:54 +01:00
parent d9ce3ca1cb
commit 6a6ec9c39b
3 changed files with 53 additions and 3 deletions

48
Makefile Normal file
View File

@ -0,0 +1,48 @@
db ?= -cf
.PHONY: help
help:
@echo "Nothing to see here, go away"
.PHONY: backend-%
backend-%: --stack-work-$* --backend-$* --stack-krow-$*
.PHONY: database
database: --stack-work-build --database --stack-krow-build
.PHONY: --database
--database:
(in-develop | grep -q 'In develop') || (echo "Not in develop" 1>&2; exit 1)
stack build --fast --flag uniworx:-library-only --flag uniworx:dev
export SERVER_SESSION_ACID_FALLBACK=$${SERVER_SESSION_ACID_FALLBACK:-true}
stack exec uniworxdb -- $(db)
node_modules: package.json
yarn install
.PHONY: %.lock
%.lock:
[ -e $@ ] || touch $@
flock -en $@ :
.PHONY: --backend-build
--backend-build:
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --flag uniworx:dev
.PHONY: --stack-work-%
--stack-work-%: .stack-work.lock
[[ -e .stack-work && -e .stack-work-$* ]] && (echo ".stack-work collides with .stack-work-$*, please resolve manually" 1>&2; exit 1)
[[ -e .stack-work && ! -e .stack-work-$* ]] || mv .stack-work-$* .stack-work
.PHONY: --stack-krow-%
--stack-krow-%:
[[ -e .stack-work-$* && echo ".stack-work-$* already exists, please resolve manually" 1>&2; exit 1 ]] || mv .stack-work .stack-work-$*
flock -u .stack-work.lock
# TODO: yarn2nix target
# watch:
# while true; do \
#
# start: frontend-build frontend-build-watch yesod-start
# run-s frontend:build --parallel "frontend:build:watch" "yesod:start"

View File

@ -107,7 +107,7 @@
(final: prev: let
pkgs = import nixpkgs { inherit system; };
in {
inherit (pkgs) dockerTools yarn yarn2nix glibcLocalesUtf8 tzdata chromium minio minio-client skopeo; inherit (pkgs.stdenv) fetchurlBoot;
inherit (pkgs) dockerTools yarn glibcLocalesUtf8 tzdata chromium minio minio-client skopeo; inherit (pkgs.stdenv) fetchurlBoot;
stack = pkgs.symlinkJoin {
inherit (pkgs.stack) name;
paths = [pkgs.stack];

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2023 Gregor Kleen <gregor@kleen.consulting>, Sarah Vaupel <sarah.vaupel@uniworx.de>, Steffen Jost <jost@tcs.ifi.lmu.de>
# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor@kleen.consulting>, Steffen Jost <jost@tcs.ifi.lmu.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
@ -180,6 +180,8 @@ let
PGHOST=''${pgSockDir}
PGLOG=''${pgLogFile}
AVSPASS=''${AVSPASS:-nopasswordset}
WIDGET_MEMCACHED_HOST=localhost
WIDGET_MEMCACHED_PORT=$(($PORT_OFFSET + 11211))
@ -274,7 +276,7 @@ in pkgs.mkShell {
nativeBuildInputs = [develop inDevelop killallUni2work diffRunning]
++ (with pkgs;
[ stack nodejs_21 yarn postgresql_12 openldap exiftool expat memcached minio minio-client
gup reuse pre-commit
gnumake gup reuse pre-commit
yarn2nix
# busybox # for print services, but interferes with build commands in develop-shell
htop