From e5e325154bd83404428b7d9c6f1af442ef57e91d Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 21 Sep 2018 09:42:50 -0700 Subject: [PATCH] Add --shell argument --- ci/docker-run.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ci/docker-run.sh b/ci/docker-run.sh index 370f25f7ca..628b661959 100755 --- a/ci/docker-run.sh +++ b/ci/docker-run.sh @@ -7,11 +7,18 @@ usage() { echo a CI-appropriate environment. echo echo "--nopull Skip the dockerhub image update" + echo "--shell Skip command and enter an interactive shell" echo } cd "$(dirname "$0")/.." +INTERACTIVE=false +if [[ $1 = --shell ]]; then + INTERACTIVE=true + shift +fi + NOPULL=false if [[ $1 = --nopull ]]; then NOPULL=true @@ -64,5 +71,15 @@ ARGS+=( --env SNAPCRAFT_CREDENTIALS_KEY ) +if $INTERACTIVE; then + if [[ -n $1 ]]; then + echo + echo "Note: '$*' ignored due to --shell argument" + echo + fi + set -x + exec docker run --interactive --tty "${ARGS[@]}" "$IMAGE" bash +fi + set -x exec docker run "${ARGS[@]}" "$IMAGE" "$@"