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."
@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:
$(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