This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree 1 file changed +16
-18
lines changed
1 file changed +16
-18
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
1
3
# Small script to run tests for a target (or all targets) inside all the
2
4
# respective docker images.
3
5
4
6
set -ex
5
7
6
8
run () {
7
- local target=$1
8
-
9
- echo $target
10
-
11
9
# This directory needs to exist before calling docker, otherwise docker will create it but it
12
10
# will be owned by root
13
11
mkdir -p target
14
12
15
- docker build -t $target -f ci/docker/$target /Dockerfile ci/
13
+ docker build -t " ${1} " -f " ci/docker/${1} /Dockerfile" ci/
16
14
docker run \
17
15
--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 \
25
23
--init \
26
- -w /checkout \
24
+ --workdir /checkout \
27
25
--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} "
30
28
}
31
29
32
30
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} "
35
33
done
36
34
else
37
- run $1
35
+ run " ${1} "
38
36
fi
You can’t perform that action at this time.
0 commit comments