From f34bbaf752080c6c7a8e1e063fe864420e961f76 Mon Sep 17 00:00:00 2001 From: Kyle Bowman Date: Thu, 10 Apr 2025 07:36:53 -0400 Subject: [PATCH] add make tty for interactive troubleshooting --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7d2a5f6..93ee6ce 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,9 @@ IMAGE_NAME=my_bats CONTAINER_NAME=my_bats_container CONTAINER_MOUNT:=/workspace CONTAINER_BATS:=/usr/bin/bats +CONTAINER_SHELL :=/usr/bin/bash -.PHONY: build clean help test +.PHONY: build clean help test tty help: @echo "Mounts the current directory and runs shell-based tests in a sandboxed." @@ -16,6 +17,7 @@ help: @echo " build builds the container." @echo " clean removes container, image, and sentinel file." @echo " test runs tests at $(PWD)/tests/*.bats" + @echo " tty runs an interactive shell in a new container. " @echo clean: @@ -35,5 +37,11 @@ test: .build $(CONTAINER_CMD) run \ --interactive --tty \ --name=$(CONTAINER_NAME) \ - --volume=$(PWD):$(CONTAINER_MOUNT) my_bats \ - $(CONTAINER_BATS) $(CONTAINER_MOUNT)/tests \ No newline at end of file + --volume=$(PWD):$(CONTAINER_MOUNT) $(IMAGE_NAME) \ + $(CONTAINER_BATS) $(CONTAINER_MOUNT)/tests + +tty: .build + $(CONTAINER_CMD) run \ + --interactive --tty \ + --volume=$(PWD):$(CONTAINER_MOUNT) $(IMAGE_NAME) \ + $(CONTAINER_SHELL) \ No newline at end of file -- 2.39.5