Use NODE_ENV to test for test environment; improve scripts
This commit is contained in:
12
npm
12
npm
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
docker run --rm --init -it -v $PWD:/usr/src/app -u $(id -u):$(id -u) -p 8080:8080 btroops npm $@
|
||||
user_id=$(id -u)
|
||||
image=btroops
|
||||
|
||||
if [[ $1 == run && $2 == test* ]]
|
||||
then
|
||||
port=3005
|
||||
else
|
||||
port=8080
|
||||
fi
|
||||
|
||||
docker run --rm --init -it -v $PWD:/usr/src/app -u $user_id:$user_id -p $port:$port $image npm $@
|
||||
|
||||
Reference in New Issue
Block a user