From b99472288d7b21691d7756636d54d64c10372683 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Wed, 6 Nov 2024 15:28:16 +0100 Subject: [PATCH] build(Makefile): implement dependencies-backend target --- Makefile | 9 +++++++++ docker/backend/Dockerfile | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4ba85bcbf..eca2652db 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,12 @@ compile-%: CF_PREFIX = compile- compile-%: CONTAINER_ATTACHED = true compile-%: --act ; +.PHONY: dependencies-% +compile-%: JOB=dependencies +compile-%: CF_PREFIX = dependencies- +compile-%: CONTAINER_ATTACHED = true +compile-%: --act ; + .PHONY: test-% test-%: JOB=test test-%: CF_PREFIX = test- @@ -232,6 +238,9 @@ endif # HELP(compile-backend): compile backend binaries --compile-backend: stack build --fast --profile --library-profiling --lock-file ignore --executable-profiling --flag uniworx:-library-only $(--DEVELOPMENT) --local-bin-path $$(pwd)/bin +# HELP(dependencies-backend): (re-)build backend dependencies +--dependencies-backend: stack.yaml stack.yaml.lock package.yaml + stack build --fast --only-dependencies # HELP(lint-backend): lint backend --lint-backend: stack build --test --fast --work-dir=.stack-work-test --flag uniworx:library-only $(--DEVELOPMENT) uniworx:test:hlint diff --git a/docker/backend/Dockerfile b/docker/backend/Dockerfile index ac56909b4..d8e0b9003 100644 --- a/docker/backend/Dockerfile +++ b/docker/backend/Dockerfile @@ -20,7 +20,7 @@ ENV HOME="${PROJECT_DIR}" RUN mkdir -p "${PROJECT_DIR}/.stack" ENV STACK_ROOT="${PROJECT_DIR}/.stack" -RUN make -- --.stack STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true +RUN make -- --dependencies-backend STACK_ROOT=${STACK_ROOT} IN_CONTAINER=true RUN stack --work-dir .stack-work-run install yesod-bin RUN chmod -R 777 .stack .stack-work-build .stack-work-run .stack-work-test .stack-work-doc || :