From: Kyle Bowman Date: Thu, 10 Apr 2025 11:36:53 +0000 (-0400) Subject: add make tty for interactive troubleshooting X-Git-Url: https://git.rocketbowman.com/?a=commitdiff_plain;h=f34bbaf752080c6c7a8e1e063fe864420e961f76;p=belfry.git add make tty for interactive troubleshooting --- 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