]> git.rocketbowman.com Git - belfry.git/commitdiff
add make tty for interactive troubleshooting
authorKyle Bowman <kyle+github@rocketbowman.com>
Thu, 10 Apr 2025 11:36:53 +0000 (07:36 -0400)
committerKyle Bowman <kyle+github@rocketbowman.com>
Thu, 10 Apr 2025 11:36:53 +0000 (07:36 -0400)
Makefile

index 7d2a5f63fa559f86e863bb3fa5d11fb76b5c9020..93ee6ce9858ed3d7f511fd447c6ebd901370ea96 100644 (file)
--- 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