Skip to content

Commit

Permalink
Add support for --interactive in mktree.podman
Browse files Browse the repository at this point in the history
Pass this option, if specified, to $PODMAN.  This is needed for
unattended use of mktree.podman where no tty is allocated, such as
GitHub Actions.

Use it as follows:

  ./mktree.podman check --interactive=false ...

Default to true (by keeping -i in the command line) still, it allows
CTRL-C to work when running the script interactively.

Based on a patch by @Conan-Kudo.
  • Loading branch information
dmnks committed Aug 3, 2023
1 parent 39ebe1e commit 2387539
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/mktree.podman
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ case $CMD in
exit 0
;;
check)
# Pass select options to $PODMAN
case "$1" in
# Useful for CI environments without a tty
--interactive=*) OPTS=$1; shift ;;
*) OPTS= ;;
esac
$PODMAN run --privileged -it --rm --read-only --tmpfs /tmp \
-v /srv --workdir /srv -e ROOTLESS=$ROOTLESS \
$IMAGE mktree check "$@"
$OPTS $IMAGE mktree check "$@"
;;
reset)
$PODMAN stop $NAME >/dev/null &&
Expand Down

0 comments on commit 2387539

Please sign in to comment.