GeezerVison is showing github.com — added run-in-docker.sh · ccare/javascript-test-runner@7dc851c
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +23Lines changed: 23 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Synopsis: |
| 4 | +# Test runner for run.sh in a docker container |
| 5 | +# Takes the same arguments as run.sh (EXCEPT THAT SOLUTION PATH IS RELATIVE) |
| 6 | +# Builds the Dockerfile |
| 7 | +# Runs the docker image passing along the initial arguments |
| 8 | + |
| 9 | +# Arguments: |
| 10 | +# $1: exercise slug |
| 11 | +# $2: **RELATIVE** path to solution folder (without trailing slash) |
| 12 | + |
| 13 | +# Output: |
| 14 | +# [For now] writes the tests output to the terminal |
| 15 | + |
| 16 | +# Example: |
| 17 | +# ./run-in-docker.sh two-fer ./relative/path/to/two-fer/solution/folder |
| 18 | + |
| 19 | +# build docker image |
| 20 | +docker build -t javascript-test-runner . |
| 21 | + |
| 22 | +# run image passing the arguments |
| 23 | +docker run -v $PWD/$2:/solution javascript-test-runner $1 /solution |