diff --git a/Makefile b/Makefile index 3b4f56ffa..24e74e52f 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,10 @@ export CONTAINER_FILE export CF_PREFIX export DEVELOP export MOUNT_DIR=/mnt/fradrive +# CONTAINER_RUNMODE variants: +# detached: detached container +# attached: attached container +export CONTAINER_RUNMODE ?= detached export SERVICE export SERVICE_VARIANT ?= $(SERVICE) @@ -130,16 +134,19 @@ start-%: --act ; .PHONY: compile-% compile-%: JOB=compile compile-%: CF_PREFIX = "compile-" +compile-%: CONTAINER_RUNMODE = "attached" compile-%: --act ; .PHONY: test-% test-%: JOB=test test-%: CF_PREFIX = "test-" +test-%: CONTAINER_RUNMODE = "attached" test-%: --act ; .PHONY: lint-% lint-%: JOB=lint lint-%: CF_PREFIX = "lint-" +lint-%: CONTAINER_RUNMODE = "attached" lint-%: --act ; --act: --develop_containerized; @@ -197,7 +204,10 @@ endif --name $${CONTAINER_NAME} \ $(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 --start-backend: