Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for local docker testing. #73952

Merged
merged 1 commit into from
Jul 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
Expand Down Expand Up @@ -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 \
Expand All @@ -183,7 +212,7 @@ docker \
--init \
--rm \
rust-ci \
/checkout/src/ci/run.sh
$command

if [ -f /.dockerenv ]; then
rm -rf $objdir
Expand Down