GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript-test-runner/run-in-docker.sh at main · codeaway-io/javascript-test-runner

Expand file tree

/

run-in-docker.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
35 lines (28 loc) · 1.14 KB
/

run-in-docker.sh

Copy path

File metadata and controls

executable file
·
35 lines (28 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
33
34
35
#!/usr/bin/env bash
# Synopsis:
# Test runner for run.sh in a docker container
# Takes the same arguments as run.sh (EXCEPT THAT SOLUTION AND OUTPUT PATH ARE RELATIVE)
# Builds the Dockerfile
# Runs the docker image passing along the initial arguments
# Arguments:
# $1: exercise slug
# $2: **RELATIVE** path to solution folder (without trailing slash)
# $3: **RELATIVE** path to output directory (without trailing slash)
# Output:
# Writes the tests output to the output directory
# Example:
# ./run-in-docker.sh two-fer ./relative/path/to/two-fer/solution/folder/ ./relative/path/to/output-directory/
# If arguments not provided, print usage and exit
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
echo "usage: ./run-in-docker.sh two-fer ./relative/path/to/two-fer/solution/folder/ ./relative/path/to/output-directory/"
fi
# build docker image
docker build -t javascript-test-runner .
# run image passing the arguments
docker run \
--network none \
--read-only \
--mount type=bind,src=$PWD/$2,dst=/solution/ \
--mount type=bind,src=$PWD/$3,dst=/output/ \
--mount type=tmpfs,dst=/tmp \
javascript-test-runner $1 /solution/ /output/
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.