Teach docker-run to run interactively or to be able to run from a non-interactive process like a git hook

Fixes #959
pull/929/head
Jesse Vincent 4 years ago
parent f14e991e58
commit b70b851321
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -4,6 +4,14 @@ set -e
uname_S=$(uname -s 2>/dev/null || echo not)
# If we're running in a terminal and want interactive docker
# Specifically "is there a STDIN file descriptor"
if [ -t 0 ]; then
: "${DOCKER_RUN_INTERACTIVE_OPTS:=--tty --interactive}"
fi
if [ "${uname_S}" = "Darwin" ]; then
ARDUINO_LOCAL_LIB_PATH="${ARDUINO_LOCAL_LIB_PATH:-${HOME}/Documents/Arduino}"
# This stops macos from copying resource forks into thigns like tar
@ -28,7 +36,8 @@ tar -cf "${XFER_DIR}/kaleidoscope.tar" \
echo "Building the docker image..."
docker build -q -t kaleidoscope/docker etc
docker run --rm -it \
# shellcheck disable=SC2086 # We do want word splitting since there are multiple options here
docker run --rm $DOCKER_RUN_INTERACTIVE_OPTS \
--tmpfs /kaleidoscope:exec \
--mount type=bind,source="${XFER_DIR}",destination=/kaleidoscope-src,consistency=delegated,readonly \
--mount type=volume,source=kaleidoscope-persist,destination=/kaleidoscope-persist,consistency=delegated \

Loading…
Cancel
Save