-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
run-in-docker.bat
32 lines (26 loc) · 1.1 KB
/
run-in-docker.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@@ -0,0 +1,31 @@
@REM Only works in bash for windows and similar terminals that accept / paths
@REM Synopsis:
@REM Test runner for run.sh in a docker container
@REM Takes the same arguments as run.sh (EXCEPT THAT SOLUTION AND OUTPUT PATH ARE RELATIVE)
@REM Builds the Dockerfile
@REM Runs the docker image passing along the initial arguments
@REM Arguments:
@REM $1: exercise slug
@REM $2: **RELATIVE** path to solution folder (without trailing slash)
@REM $3: **RELATIVE** path to output directory (without trailing slash)
@REM Output:
@REM Writes the tests output to the output directory
@REM Example:
@REM ./run-in-docker.bat two-fer ./relative/path/to/two-fer/solution/folder/ ./relative/path/to/output-directory/
@REM ./run-in-docker.bat two-fer ./test/fixtures/two-fer/pass ./test/fixtures/two-fer/pass
@REM build docker image
docker build -t typescript-test-runner .
@REM run image passing the arguments
docker run^
--network none^
--read-only^
--mount type=bind,src=%cd%/%2,dst=/solution/^
--mount type=bind,src=%cd%/%3,dst=/output/^
--mount type=tmpfs,dst=/tmp^
typescript-test-runner %1 /solution/ /output/