build(Makefile): Reattach container that are meant to be foreground.

This commit is contained in:
Stephan Barth 2024-11-04 15:34:00 +01:00
parent da35d404de
commit a5d270ccf4

View File

@ -16,6 +16,10 @@ export CONTAINER_FILE
export CF_PREFIX export CF_PREFIX
export DEVELOP export DEVELOP
export MOUNT_DIR=/mnt/fradrive export MOUNT_DIR=/mnt/fradrive
# CONTAINER_RUNMODE variants:
# detached: detached container
# attached: attached container
export CONTAINER_RUNMODE ?= detached
export SERVICE export SERVICE
export SERVICE_VARIANT ?= $(SERVICE) export SERVICE_VARIANT ?= $(SERVICE)
@ -130,16 +134,19 @@ start-%: --act ;
.PHONY: compile-% .PHONY: compile-%
compile-%: JOB=compile compile-%: JOB=compile
compile-%: CF_PREFIX = "compile-" compile-%: CF_PREFIX = "compile-"
compile-%: CONTAINER_RUNMODE = "attached"
compile-%: --act ; compile-%: --act ;
.PHONY: test-% .PHONY: test-%
test-%: JOB=test test-%: JOB=test
test-%: CF_PREFIX = "test-" test-%: CF_PREFIX = "test-"
test-%: CONTAINER_RUNMODE = "attached"
test-%: --act ; test-%: --act ;
.PHONY: lint-% .PHONY: lint-%
lint-%: JOB=lint lint-%: JOB=lint
lint-%: CF_PREFIX = "lint-" lint-%: CF_PREFIX = "lint-"
lint-%: CONTAINER_RUNMODE = "attached"
lint-%: --act ; lint-%: --act ;
--act: --develop_containerized; --act: --develop_containerized;
@ -197,7 +204,10 @@ endif
--name $${CONTAINER_NAME} \ --name $${CONTAINER_NAME} \
$(CONTAINER_CMD) \ $(CONTAINER_CMD) \
` ; \ ` ; \
printf "CONTAINER_ID=$${CONTAINER_ID}" >> "$(CONTAINER_FILE)" printf "CONTAINER_ID=$${CONTAINER_ID}" >> "$(CONTAINER_FILE)" ; \
if [[ "attached" -eq $(CONTAINER_RUNMODE) ]] ; then \
$(CONTAINER_COMMAND) attach $${CONTAINER_ID} ; \
fi
# HELP(start-backend): start yesod-devel instance # HELP(start-backend): start yesod-devel instance
--start-backend: --start-backend: