Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-18 12:02:08 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-18 12:02:08 -0700
commit25172dafedc72f9691086b7ace3137c8aaf89fd1 (patch)
treed2a633d06f6430ea68297959dcd0f5b13f1e6a10 /run-test
parentc1f575a9c6c38a2a362d4e4b25627e36b782a063 (diff)
Add Docker command scripts
Diffstat (limited to 'run-test')
-rwxr-xr-xrun-test11
1 files changed, 11 insertions, 0 deletions
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