Refactor build.sh
- build.sh runs non-interactively - build-tty.sh runs interactively with a pseudo tty - both are shims to build-run.sh - monad-native no longer depends on a tty
This commit is contained in:
parent
b14a455343
commit
d0e93b6b7f
4 changed files with 22 additions and 8 deletions
14
scripts/build-run.sh
Executable file
14
scripts/build-run.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# --rm: always run ephemerally
|
||||
# --volume: path must be absolute, so resolve it
|
||||
# --workdir: start location for Make
|
||||
# $DOCKERFLAGS: additional flags
|
||||
# magrathea: contains all dependencies
|
||||
# bash: use $* over $@ so that multi-word parameters aren't split up
|
||||
docker run --rm \
|
||||
--volume $(dirname $(pwd))/:/opt/monad-linux \
|
||||
--workdir /opt/monad-linux/scripts \
|
||||
$DOCKERFLAGS \
|
||||
andschwa/magrathea:latest \
|
||||
bash -c "$*"
|
4
scripts/build-tty.sh
Executable file
4
scripts/build-tty.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# Runs with a pseudo tty so that interactive shells can be opened
|
||||
DOCKERFLAGS="--interactive --tty" ./build-run.sh "$*"
|
|
@ -1,9 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# Docker requires the volume path to be absolute... so we resolve it ourselves.
|
||||
docker run --rm --interactive --tty \
|
||||
--volume $(dirname $(pwd))/:/opt/monad \
|
||||
--workdir /opt/monad/scripts \
|
||||
andschwa/magrathea:latest \
|
||||
bash -c "/opt/fakelogin; $*"
|
||||
# we use $* over $@ so that multi-word parameters aren't split up
|
||||
echo "$*"
|
||||
# Runs by non-interactively, just attaches output
|
||||
DOCKERFLAGS="--attach STDOUT --attach STDERR" ./build-run.sh "$*"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5693da6a46e8c4d63a49a6dbc6be3081ce7d0d08
|
||||
Subproject commit 1366e3bc8fa2df702d2fc5c1dda65e54b51e36ea
|
Loading…
Reference in a new issue