index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-04-18 12:02:08 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-04-18 12:02:08 -0700 |
commit | 25172dafedc72f9691086b7ace3137c8aaf89fd1 (patch) | |
tree | d2a633d06f6430ea68297959dcd0f5b13f1e6a10 | |
parent | c1f575a9c6c38a2a362d4e4b25627e36b782a063 (diff) |
Add Docker command scripts
-rw-r--r-- | README.md | 8 | ||||
-rwxr-xr-x | run-start | 3 | ||||
-rwxr-xr-x | run-test | 11 |
3 files changed, 22 insertions, 0 deletions
@@ -6,6 +6,10 @@ docker run --rm --init -it -v $PWD:/usr/src/app -p 8080:8080 btroops +or, run the start script + + ./run-start + Visit `localhost:8080` to view. ## Run a test @@ -22,6 +26,10 @@ The container can access the outside without setting a port or a network. The ne docker run --rm -it -v $PWD:/usr/src/app btroops npm run test:integ +or, run the test script + + ./run-test + ## Rough way to save the SVG map generated by JavaScript client-side const XMLS = new XMLSerializer(); diff --git a/run-start b/run-start new file mode 100755 index 0000000..919ff20 --- /dev/null +++ b/run-start @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker run --rm --init -it -v $PWD:/usr/src/app -p 8080:8080 btroops diff --git a/run-test b/run-test new file mode 100755 index 0000000..1c162ba --- /dev/null +++ b/run-test @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +NPM_COMMAND="npm run test:integ" +CONTAINER_NAME=$(docker container ls --all --filter=ancestor=btroops --format "{{.Names}}") + +if [[ -z "${CONTAINER_NAME}" ]] +then + docker run --rm -it -v $PWD:/usr/src/app btroops $NPM_COMMAND +else + docker exec -it $CONTAINER_NAME $NPM_COMMAND +fi |