Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 0d6ace2

Browse files
committed
Set proper run_docker.sh volumes
1 parent 5ccb081 commit 0d6ace2

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

ci/run-docker.sh

+16-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1+
#!/usr/bin/env sh
2+
13
# Small script to run tests for a target (or all targets) inside all the
24
# respective docker images.
35

46
set -ex
57

68
run() {
7-
local target=$1
8-
9-
echo $target
10-
119
# This directory needs to exist before calling docker, otherwise docker will create it but it
1210
# will be owned by root
1311
mkdir -p target
1412

15-
docker build -t $target -f ci/docker/$target/Dockerfile ci/
13+
docker build -t "${1}" -f "ci/docker/${1}/Dockerfile" ci/
1614
docker run \
1715
--rm \
18-
--user $(id -u):$(id -g) \
19-
-e CARGO_HOME=/cargo \
20-
-e CARGO_TARGET_DIR=/target \
21-
-v $(dirname $(dirname `which cargo`)):/cargo \
22-
-v `pwd`/target:/target \
23-
-v `pwd`:/checkout:ro \
24-
-v `rustc --print sysroot`:/rust:ro \
16+
--user "$(id -u)":"$(id -g)" \
17+
--env CARGO_HOME=/cargo \
18+
--env CARGO_TARGET_DIR=/checkout/target \
19+
--volume "$(dirname "$(dirname "$(command -v cargo)")")":/cargo \
20+
--volume "$(rustc --print sysroot)":/rust:ro \
21+
--volume "$(pwd)":/checkout:ro \
22+
--volume "$(pwd)"/target:/checkout/target \
2523
--init \
26-
-w /checkout \
24+
--workdir /checkout \
2725
--privileged \
28-
$target \
29-
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/run.sh $target"
26+
"${1}" \
27+
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/run.sh ${1}"
3028
}
3129

3230
if [ -z "$1" ]; then
33-
for d in `ls ci/docker/`; do
34-
run $d
31+
for d in ci/docker/*; do
32+
run "${d}"
3533
done
3634
else
37-
run $1
35+
run "${1}"
3836
fi

0 commit comments

Comments
 (0)