Add Docker command scripts
This commit is contained in:
parent
c1f575a9c6
commit
25172dafed
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
docker run --rm --init -it -v $PWD:/usr/src/app -p 8080:8080 btroops
|
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.
|
Visit `localhost:8080` to view.
|
||||||
|
|
||||||
## Run a test
|
## 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
|
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
|
## Rough way to save the SVG map generated by JavaScript client-side
|
||||||
|
|
||||||
const XMLS = new XMLSerializer();
|
const XMLS = new XMLSerializer();
|
||||||
|
3
run-start
Executable file
3
run-start
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
docker run --rm --init -it -v $PWD:/usr/src/app -p 8080:8080 btroops
|
11
run-test
Executable file
11
run-test
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user