mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-27 14:14:30 +08:00
btrfs-progs: ci: check if docker run has a terminal
Using 'docker run -it' works for interactive sessions but not inside the CI environment. We want both so make it optional by detecting if stdin is a terminal. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
cb0bf52edc
commit
5eb5ff2bdf
@ -16,7 +16,13 @@ done
|
||||
echo "ARGS: ${ARGS[@]}"
|
||||
echo "RUN : $@"
|
||||
|
||||
# Running inside non-interactive terminal would fail
|
||||
tty=
|
||||
if [ -t 1 ]; then
|
||||
tty=-it
|
||||
fi
|
||||
|
||||
# Device mapper devices are not visible inside the environment if the /dev mount
|
||||
# is the default one (tmpfs instead of devtmpfs)
|
||||
# Mounts and loop device manipulation is required
|
||||
docker run --mount type=bind,source=/dev,target=/dev -it --privileged "${ARGS[@]}" "$prefix/$image" "$@"
|
||||
docker run --mount type=bind,source=/dev,target=/dev $tty --privileged "${ARGS[@]}" "$prefix/$image" "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user