diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-02 15:55:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-02 15:55:59 -0700 |
| commit | 441dd5ad45fc65468ab05b6e6b3409cfdf70dfbd (patch) | |
| tree | 7deebca39513ad78476d9dde8d4203556901c411 | |
| parent | 7ad8ed96f287e13441caf3c51226159e3b86d119 (diff) | |
| parent | 4dc5685220466d67bb009c3dec08d8a89aeddd0e (diff) | |
| download | rust-441dd5ad45fc65468ab05b6e6b3409cfdf70dfbd.tar.gz rust-441dd5ad45fc65468ab05b6e6b3409cfdf70dfbd.zip | |
Rollup merge of #73952 - ehuss:docker-dev, r=Mark-Simulacrum
Add option for local docker testing. This adds the option `--dev` to `src/ci/docker/run.sh` so that it will enter an interactive environment for local testing. I have often needed this for testing things, but I always needed to edit this script. I wanted the ability to interact in the environment, run different commands, inspect errors, etc.
| -rwxr-xr-x | src/ci/docker/run.sh | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index d891ad1b668..8071b635804 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -5,7 +5,27 @@ set -e export MSYS_NO_PATHCONV=1 script=`cd $(dirname $0) && pwd`/`basename $0` -image=$1 + +image="" +dev=0 + +while [[ $# -gt 0 ]] +do + case "$1" in + --dev) + dev=1 + ;; + *) + if [ -n "$image" ] + then + echo "expected single argument for the image name" + exit 1 + fi + image="$1" + ;; + esac + shift +done docker_dir="`dirname $script`" ci_dir="`dirname $docker_dir`" @@ -163,6 +183,15 @@ else args="$args --env LOCAL_USER_ID=`id -u`" fi +if [ "$dev" = "1" ] +then + # Interactive + TTY + args="$args -it" + command="/bin/bash" +else + command="/checkout/src/ci/run.sh" +fi + docker \ run \ --workdir /checkout/obj \ @@ -183,7 +212,7 @@ docker \ --init \ --rm \ rust-ci \ - /checkout/src/ci/run.sh + $command if [ -f /.dockerenv ]; then rm -rf $objdir |
